Skip to content

Commit 09e79db

Browse files
authored
Add example command to create /etc/apt/keyrings directory (#43626)
* create folder for key The following command will fail without the folder created manually beforhand. ``` curl -fsSL https://dl.k8s.io/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg ``` * updated instruction updated according to the comment in the PR * updated mkdir part * Updated mkdir
1 parent ef9194b commit 09e79db

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

content/en/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,14 @@ These instructions are for Kubernetes {{< skew currentVersion >}}.
182182
The same signing key is used for all repositories so you can disregard the version in the URL:
183183

184184
```shell
185+
# If the folder `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below.
186+
# sudo mkdir -p -m 755 /etc/apt/keyrings
185187
curl -fsSL https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
186188
```
189+
190+
{{< note >}}
191+
In releases older than Debian 12 and Ubuntu 22.04, folder `/etc/apt/keyrings` does not exist by default, and it should be created before the curl command.
192+
{{< /note >}}
187193

188194
{{< note >}}
189195
In releases older than Debian 12 and Ubuntu 22.04, `/etc/apt/keyrings` does not exist by default;

content/en/docs/tasks/tools/install-kubectl-linux.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,14 @@ The following methods exist for installing kubectl on Linux:
136136
2. Download the public signing key for the Kubernetes package repositories. The same signing key is used for all repositories so you can disregard the version in the URL:
137137

138138
```shell
139+
# If the folder `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below.
140+
# sudo mkdir -p -m 755 /etc/apt/keyrings
139141
curl -fsSL https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
140142
```
143+
144+
{{< note >}}
145+
In releases older than Debian 12 and Ubuntu 22.04, folder `/etc/apt/keyrings` does not exist by default, and it should be created before the curl command.
146+
{{< /note >}}
141147

142148
3. Add the appropriate Kubernetes `apt` repository. If you want to use Kubernetes version different than {{< param "version" >}},
143149
replace {{< param "version" >}} with the desired minor version in the command below:
@@ -158,10 +164,6 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
158164
sudo apt-get install -y kubectl
159165
```
160166

161-
{{< note >}}
162-
In releases older than Debian 12 and Ubuntu 22.04, `/etc/apt/keyrings` does not exist by default, and can be created using `sudo mkdir -m 755 /etc/apt/keyrings`
163-
{{< /note >}}
164-
165167
{{% /tab %}}
166168

167169
{{% tab name="Red Hat-based distributions" %}}

0 commit comments

Comments
 (0)