-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update apt for Kubernetes in vagrant playbook #6114
Conversation
@@ -1,15 +1,16 @@ | |||
- name: Add an apt signing key for Kubernetes | |||
apt_key: | |||
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg | |||
url: https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a good idea to bind it with a specific version. You may check this thread:
kubernetes/release#2862 (comment)
We may just need to update the location of the file to /usr/share/keyrings/cloud.google.gpg
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @luolanzone for not binding to a specific version. I think we can fetch the latest stable release from https://dl.k8s.io/release/stable.txt and extract the major.minor version.
For signing keys I think we should use keys from pkgs.k8s.io as Google-hosted package repositories are removed on Jan 2024.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated so that we are following this https://kubernetes.io/blog/2023/08/15/pkgs-k8s-io-introduction/#how-to-migrate and replacing the version as suggested, for both the signing key and apt repository.
@@ -1,15 +1,16 @@ | |||
- name: Add an apt signing key for Kubernetes | |||
apt_key: | |||
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg | |||
url: https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @luolanzone for not binding to a specific version. I think we can fetch the latest stable release from https://dl.k8s.io/release/stable.txt and extract the major.minor version.
For signing keys I think we should use keys from pkgs.k8s.io as Google-hosted package repositories are removed on Jan 2024.
state: present | ||
filename: kubernetes.list | ||
filename: /etc/apt/sources.list.d/kubernetes.list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just filename: "kubernetes"
would also work.
Ansible will take care of the path and filename extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the change.
Perhaps change the title to "Update apt for Kubernetes in vagrant playbook" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can remove the outdated comments as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed👍
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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/skip-all |
As legacy Linux package repositories for Kubernetes are frozen, the old vagrant playbook throws an error.
This change updates the apt_key and apt_repository for Kubernetes in vagrant playbook.
Reference: https://kubernetes.io/blog/2023/08/15/pkgs-k8s-io-introduction/#how-to-migrate
https://dl.k8s.io/release/stable.txt