From e15b943a5aa66aaa78f2baa3b41dbcfe03c624cc Mon Sep 17 00:00:00 2001 From: fbauzac Date: Tue, 9 Jan 2024 10:01:10 +0100 Subject: [PATCH 1/3] install-kubectl-linux.md: add chmods The keyring needs to be readable by _apt, otherwise "apt update" prints the following kind of error: W: GPG error: https://prod-cdn.packages.k8s.io/repositories/isv:/kubernetes:/core:/stable:/v1.29/deb InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 234654DA9A296436 E: The repository 'https://pkgs.k8s.io/core:/stable:/v1.29/deb InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. kubernetes.list needs to be world-readable, otherwise command-not-found prints warnings such as: WARNING:root:could not open file '/etc/apt/sources.list.d/kubernetes.list' --- content/en/docs/tasks/tools/install-kubectl-linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/en/docs/tasks/tools/install-kubectl-linux.md b/content/en/docs/tasks/tools/install-kubectl-linux.md index ef7a87889a..94cbc1ef05 100644 --- a/content/en/docs/tasks/tools/install-kubectl-linux.md +++ b/content/en/docs/tasks/tools/install-kubectl-linux.md @@ -137,6 +137,7 @@ The following methods exist for installing kubectl on Linux: ```shell curl -fsSL https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg + sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # Needed so that _apt user can read it ``` 3. Add the appropriate Kubernetes `apt` repository. If you want to use Kubernetes version different than {{< param "version" >}}, @@ -145,6 +146,7 @@ The following methods exist for installing kubectl on Linux: ```shell # This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list + sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # Needed so that command-not-found works correctly ``` {{< note >}} From 93197739605e4c3e86d0d11682a40856dfabaf33 Mon Sep 17 00:00:00 2001 From: fbauzac Date: Wed, 13 Mar 2024 15:17:26 +0100 Subject: [PATCH 2/3] Update content/en/docs/tasks/tools/install-kubectl-linux.md Co-authored-by: Tim Bannister --- content/en/docs/tasks/tools/install-kubectl-linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/tools/install-kubectl-linux.md b/content/en/docs/tasks/tools/install-kubectl-linux.md index 94cbc1ef05..89b14f2fb4 100644 --- a/content/en/docs/tasks/tools/install-kubectl-linux.md +++ b/content/en/docs/tasks/tools/install-kubectl-linux.md @@ -137,7 +137,7 @@ The following methods exist for installing kubectl on Linux: ```shell curl -fsSL https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg - sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # Needed so that _apt user can read it + sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring ``` 3. Add the appropriate Kubernetes `apt` repository. If you want to use Kubernetes version different than {{< param "version" >}}, From d79889619887dec90b447a6cce537755b7e60f68 Mon Sep 17 00:00:00 2001 From: fbauzac Date: Wed, 13 Mar 2024 15:17:35 +0100 Subject: [PATCH 3/3] Update content/en/docs/tasks/tools/install-kubectl-linux.md Co-authored-by: Tim Bannister --- content/en/docs/tasks/tools/install-kubectl-linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/tools/install-kubectl-linux.md b/content/en/docs/tasks/tools/install-kubectl-linux.md index 89b14f2fb4..f958bddf85 100644 --- a/content/en/docs/tasks/tools/install-kubectl-linux.md +++ b/content/en/docs/tasks/tools/install-kubectl-linux.md @@ -146,7 +146,7 @@ The following methods exist for installing kubectl on Linux: ```shell # This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list - sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # Needed so that command-not-found works correctly + sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly ``` {{< note >}}