Skip to content

Commit 3aef33c

Browse files
authored
Merge pull request #32259 from tengqm/fix-links-3
Fix nits in the change runtime containerd page
2 parents ed8d574 + a11ecef commit 3aef33c

File tree

1 file changed

+35
-24
lines changed

1 file changed

+35
-24
lines changed

content/en/docs/tasks/administer-cluster/migrating-from-dockershim/change-runtime-containerd.md

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@ weight: 8
44
content_type: task
55
---
66

7-
This task outlines the steps needed to update your container runtime to containerd from Docker. It is applicable for cluster operators running Kubernetes 1.23 or earlier. Also this covers an example scenario for migrating from dockershim to containerd and alternative container runtimes can be picked from this [page](https://kubernetes.io/docs/setup/production-environment/container-runtimes/).
7+
This task outlines the steps needed to update your container runtime to containerd from Docker. It
8+
is applicable for cluster operators running Kubernetes 1.23 or earlier. Also this covers an
9+
example scenario for migrating from dockershim to containerd and alternative container runtimes
10+
can be picked from this [page](/docs/setup/production-environment/container-runtimes/).
811

912
## {{% heading "prerequisites" %}}
1013

1114
{{% thirdparty-content %}}
1215

13-
Install containerd. For more information see, [containerd's installation documentation](https://containerd.io/docs/getting-started/) and for specific prerequisite follow [this](/docs/setup/production-environment/container-runtimes/#containerd).
16+
Install containerd. For more information see
17+
[containerd's installation documentation](https://containerd.io/docs/getting-started/)
18+
and for specific prerequisite follow
19+
[the containerd guide](/docs/setup/production-environment/container-runtimes/#containerd).
1420

1521
## Drain the node
1622

17-
```
18-
# replace <node-to-drain> with the name of your node you are draining
23+
```shell
1924
kubectl drain <node-to-drain> --ignore-daemonsets
2025
```
26+
27+
Replace `<node-to-drain>` with the name of your node you are draining.
28+
2129
## Stop the Docker daemon
2230

2331
```shell
@@ -27,32 +35,33 @@ systemctl disable docker.service --now
2735

2836
## Install Containerd
2937

30-
This [page](/docs/setup/production-environment/container-runtimes/#containerd) contains detailed steps to install containerd.
38+
Follow the [guide](/docs/setup/production-environment/container-runtimes/#containerd)
39+
for detailed steps to install containerd.
3140

3241
{{< tabs name="tab-cri-containerd-installation" >}}
3342
{{% tab name="Linux" %}}
3443

3544
1. Install the `containerd.io` package from the official Docker repositories.
36-
Instructions for setting up the Docker repository for your respective Linux distribution and installing the `containerd.io` package can be found at
37-
[Install Docker Engine](https://docs.docker.com/engine/install/#server).
45+
Instructions for setting up the Docker repository for your respective Linux distribution and
46+
installing the `containerd.io` package can be found at
47+
[Install Docker Engine](https://docs.docker.com/engine/install/#server).
3848

39-
2. Configure containerd:
49+
1. Configure containerd:
4050

4151
```shell
4252
sudo mkdir -p /etc/containerd
4353
containerd config default | sudo tee /etc/containerd/config.toml
4454
```
45-
46-
3. Restart containerd:
55+
1. Restart containerd:
4756

4857
```shell
4958
sudo systemctl restart containerd
5059
```
51-
5260
{{% /tab %}}
5361
{{% tab name="Windows (PowerShell)" %}}
5462

55-
Start a Powershell session, set `$Version` to the desired version (ex: `$Version="1.4.3"`), and then run the following commands:
63+
Start a Powershell session, set `$Version` to the desired version (ex: `$Version="1.4.3"`), and
64+
then run the following commands:
5665

5766
1. Download containerd:
5867

@@ -89,24 +98,25 @@ Start a Powershell session, set `$Version` to the desired version (ex: `$Version
8998

9099
## Configure the kubelet to use containerd as its container runtime
91100

92-
Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtime to the flags. `--container-runtime=remote` and `--container-runtime-endpoint=unix:///run/containerd/containerd.sock"`
93-
94-
For users using kubeadm should consider the following:
101+
Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtime to the flags.
102+
`--container-runtime=remote` and
103+
`--container-runtime-endpoint=unix:///run/containerd/containerd.sock"`.
95104

96-
The `kubeadm` tool stores the CRI socket for each host as an annotation in the Node object for that host.
105+
Users using kubeadm should be aware that the `kubeadm` tool stores the CRI socket for each host as
106+
an annotation in the Node object for that host. To change it you can execute the following command
107+
on a machine that has the kubeadm `/etc/kubernetes/admin.conf` file.
97108

98-
To change it you must do the following:
99-
100-
Execute `kubectl edit no <NODE-NAME>` on a machine that has the kubeadm `/etc/kubernetes/admin.conf` file.
109+
```shell
110+
kubectl edit no <node-name>
111+
```
101112

102113
This will start a text editor where you can edit the Node object.
103-
104114
To choose a text editor you can set the `KUBE_EDITOR` environment variable.
105115

106116
- Change the value of `kubeadm.alpha.kubernetes.io/cri-socket` from `/var/run/dockershim.sock`
107-
to the CRI socket path of your choice (for example `unix:///run/containerd/containerd.sock`).
117+
to the CRI socket path of your choice (for example `unix:///run/containerd/containerd.sock`).
108118

109-
Note that new CRI socket paths must be prefixed with `unix://` ideally.
119+
Note that new CRI socket paths must be prefixed with `unix://` ideally.
110120

111121
- Save the changes in the text editor, which will update the Node object.
112122

@@ -124,7 +134,7 @@ Run `kubectl get nodes -o wide` and containerd appears as the runtime for the no
124134

125135
{{% thirdparty-content %}}
126136

127-
Finally if everything goes well remove docker
137+
Finally if everything goes well, remove Docker.
128138

129139
{{< tabs name="tab-remove-docker-enigine" >}}
130140
{{% tab name="CentOS" %}}
@@ -151,4 +161,5 @@ sudo dnf remove docker-ce docker-ce-cli
151161
sudo apt-get purge docker-ce docker-ce-cli
152162
```
153163
{{% /tab %}}
154-
{{< /tabs >}}
164+
{{< /tabs >}}
165+

0 commit comments

Comments
 (0)