Skip to content

Commit

Permalink
Update apt for Kubernetes in vagrant playbook
Browse files Browse the repository at this point in the history
As legacy Linux package repositories for Kubernetes
are frozen, we need to migrate to community-operated
repositories. It also requires specific release version.

This change updates the apt_key and apt_repository
for Kubernetes in vagrant playbook.

Signed-off-by: Qiyue Yao <[email protected]>
  • Loading branch information
qiyueyao committed Mar 20, 2024
1 parent bc54253 commit 5aaf7b0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/e2e/infra/vagrant/playbook/roles/common/tasks/kube.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
- name: Get Kubernetes stable release
uri:
url: https://dl.k8s.io/release/stable.txt
return_content: yes
register: k8sRelease

- name: Add an apt signing key for Kubernetes
vars:
k8sVersion: "{{ k8sRelease.content.split('.')[0] }}.{{ k8sRelease.content.split('.')[1] }}"
apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
url: https://pkgs.k8s.io/core:/stable:/{{ k8sVersion }}/deb/Release.key
keyring: /etc/apt/keyrings/kubernetes-apt-keyring.gpg
state: present

- name: Adding apt repository for Kubernetes
vars:
k8sVersion: "{{ k8sRelease.content.split('.')[0] }}.{{ k8sRelease.content.split('.')[1] }}"
apt_repository:
# kubernetes-xenial should work for Ubuntu 16.04+, there is no
# kubernetes-bionic
repo: deb https://packages.cloud.google.com/apt/ kubernetes-xenial main
repo: deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/{{ k8sVersion }}/deb/ /
state: present
filename: kubernetes.list

Expand Down

0 comments on commit 5aaf7b0

Please sign in to comment.