Skip to content

Commit 3184c22

Browse files
committed
kubeadm: adapt docs for 1.24 and dockershim removal
Touch the following files: - Implementation details: remove docker specifics, which is changing in 1.24 - Create cluster: small language cleanup, remove note about 1.24 - Install kubeadm: Include two up-to-date tables for Linux / Windows with known endpoints. Include cri-dockerd. - Kubelet integration: (side cleanup) use "container runtime" instead of "CRI runtime" (which is incorrect). Mention that only updating "--container-runtime-endpoint=.." is required if the user wishes to override the CR on a certain host. Dockershim->CR-foo migration guides would make the "--container-runtime=remote" flag explicit and we want to remove it at some point. - Troubleshooting kubeadm: Remove some instances of Docker troubleshooting that imply docker as default CR, or talk about old Docker versions. Be more generic about container runtimes. - Adding Windows nodes: move the containerd tab before the Docker tab, as containerd is now the default. Remove note about being explicit about --cri-socket. Add note that crictl is required for both Docker and containerd. Add note that cri-dockerd is required if the user wants to use Docker EE on Windows.
1 parent c8c474d commit 3184c22

File tree

6 files changed

+99
-99
lines changed

6 files changed

+99
-99
lines changed

content/en/docs/reference/setup-tools/kubeadm/implementation-details.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,8 @@ The user can skip specific preflight checks or all of them with the `--ignore-pr
8181
- Kubernetes system requirements:
8282
- if running on linux:
8383
- [error] if Kernel is older than the minimum required version
84-
- [error] if required cgroups subsystem aren't in set up
85-
- if using docker:
86-
- [warning/error] if Docker service does not exist, if it is disabled, if it is not active.
87-
- [error] if Docker endpoint does not exist or does not work
88-
- [warning] if docker version is not in the list of validated docker versions
89-
- If using other cri engine:
90-
- [error] if crictl socket does not answer
84+
- [error] if required cgroups subsystem aren't set up
85+
- [error] if the CRI endpoint does not answer
9186
- [error] if user is not root
9287
- [error] if the machine hostname is not a valid DNS subdomain
9388
- [warning] if the host name cannot be reached via network lookup
@@ -434,8 +429,7 @@ cluster startup problems.
434429
Please note that:
435430

436431
1. `kubeadm join` preflight checks are basically a subset `kubeadm init` preflight checks
437-
1. Starting from 1.9, kubeadm provides better support for CRI-generic functionality; in that case, docker specific controls
438-
are skipped or replaced by similar controls for crictl.
432+
1. Starting from 1.24, kubeadm uses crictl to communicate to all known CRI endpoints.
439433
1. Starting from 1.9, kubeadm provides support for joining nodes running on Windows; in that case, linux specific controls are skipped.
440434
1. In any case the user can skip specific preflight checks (or eventually all preflight checks) with the `--ignore-preflight-errors` option.
441435

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ for all control-plane nodes. Such an endpoint can be either a DNS name or an IP
111111
be passed to `kubeadm init`. Depending on which
112112
third-party provider you choose, you might need to set the `--pod-network-cidr` to
113113
a provider-specific value. See [Installing a Pod network add-on](#pod-network).
114-
1. (Optional) Since version 1.14, `kubeadm` tries to detect the container runtime on Linux
115-
by using a list of well known domain socket paths. To use different container runtime or
116-
if there are more than one installed on the provisioned node, specify the `--cri-socket`
117-
argument to `kubeadm init`. See
114+
1. (Optional) `kubeadm` tries to detect the container runtime by using a list of well
115+
known endpoints. To use different container runtime or if there are more than one installed
116+
on the provisioned node, specify the `--cri-socket` argument to `kubeadm`. See
118117
[Installing a runtime](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-runtime).
119118
1. (Optional) Unless otherwise specified, `kubeadm` uses the network interface associated
120119
with the default gateway to set the advertise address for this particular control-plane node's API server.
@@ -384,8 +383,8 @@ A few seconds later, you should notice this node in the output from `kubectl get
384383
nodes` when run on the control-plane node.
385384

386385
{{< note >}}
387-
As the cluster nodes are usually initialized sequentially, the CoreDNS Pods are likely to all run
388-
on the first control-plane node. To provide higher availability, please rebalance the CoreDNS Pods
386+
As the cluster nodes are usually initialized sequentially, the CoreDNS Pods are likely to all run
387+
on the first control-plane node. To provide higher availability, please rebalance the CoreDNS Pods
389388
with `kubectl -n kube-system rollout restart deployment coredns` after at least one new node is joined.
390389
{{< /note >}}
391390

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

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -79,51 +79,59 @@ The pod network plugin you use (see below) may also require certain ports to be
7979
open. Since this differs with each pod network plugin, please see the
8080
documentation for the plugins about what port(s) those need.
8181

82-
## Installing runtime {#installing-runtime}
82+
## Installing a container runtime {#installing-runtime}
8383

8484
To run containers in Pods, Kubernetes uses a
8585
{{< glossary_tooltip term_id="container-runtime" text="container runtime" >}}.
8686

87-
{{< tabs name="container_runtime" >}}
88-
{{% tab name="Linux nodes" %}}
89-
9087
By default, Kubernetes uses the
9188
{{< glossary_tooltip term_id="cri" text="Container Runtime Interface">}} (CRI)
9289
to interface with your chosen container runtime.
9390

9491
If you don't specify a runtime, kubeadm automatically tries to detect an installed
95-
container runtime by scanning through a list of well known Unix domain sockets.
96-
The following table lists container runtimes and their associated socket paths:
97-
98-
{{< table caption = "Container runtimes and their socket paths" >}}
99-
| Runtime | Path to Unix domain socket |
100-
|------------|-----------------------------------|
101-
| Docker | `/var/run/dockershim.sock` |
102-
| containerd | `/run/containerd/containerd.sock` |
103-
| CRI-O | `/var/run/crio/crio.sock` |
104-
{{< /table >}}
92+
container runtime by scanning through a list of known endpoints.
10593

106-
<br />
107-
If both Docker and containerd are detected, Docker takes precedence. This is
108-
needed because Docker 18.09 ships with containerd and both are detectable even if you only
109-
installed Docker.
110-
If any other two or more runtimes are detected, kubeadm exits with an error.
111-
112-
The kubelet integrates with Docker through the built-in `dockershim` CRI implementation.
94+
If multiple or no container runtimes are detected kubeadm will throw an error
95+
and will request that you specify which one you want to use.
11396

11497
See [container runtimes](/docs/setup/production-environment/container-runtimes/)
11598
for more information.
99+
100+
{{< note >}}
101+
Docker Engine does not implement the [CRI](/docs/concepts/architecture/cri/)
102+
which is a requirement for a container runtime to work with Kubernetes.
103+
For that reason, an additional service [cri-dockerd](https://github.com/Mirantis/cri-dockerd)
104+
has to be installed. cri-dockerd is a project based on the legacy built-in
105+
Docker Engine support that was [removed](/dockershim) from the kubelet in version 1.24.
106+
{{< /note >}}
107+
108+
The tables below include the known endpoints for supported operating systems:
109+
110+
{{< tabs name="container_runtime" >}}
111+
{{% tab name="Linux" %}}
112+
113+
{{< table >}}
114+
| Runtime | Path to Unix domain socket |
115+
|------------------------------------|----------------------------------------------|
116+
| containerd | `unix:///var/run/containerd/containerd.sock` |
117+
| CRI-O | `unix:///var/run/crio/crio.sock` |
118+
| Docker Engine (using cri-dockerd) | `unix:///var/run/cri-dockerd.sock` |
119+
{{< /table >}}
120+
116121
{{% /tab %}}
117-
{{% tab name="other operating systems" %}}
118-
By default, kubeadm uses {{< glossary_tooltip term_id="docker" >}} as the container runtime.
119-
The kubelet integrates with Docker through the built-in `dockershim` CRI implementation.
120122

121-
See [container runtimes](/docs/setup/production-environment/container-runtimes/)
122-
for more information.
123+
{{% tab name="Windows" %}}
124+
125+
{{< table >}}
126+
| Runtime | Path to Windows named pipe |
127+
|------------------------------------|----------------------------------------------|
128+
| containerd | `npipe:////./pipe/containerd-containerd` |
129+
| Docker Engine (using cri-dockerd) | `npipe:////./pipe/cri-dockerd` |
130+
{{< /table >}}
131+
123132
{{% /tab %}}
124133
{{< /tabs >}}
125134

126-
127135
## Installing kubeadm, kubelet and kubectl
128136

129137
You will install these packages on all of your machines:

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ using kubeadm, rather than managing the kubelet configuration for each Node manu
3636
### Propagating cluster-level configuration to each kubelet
3737

3838
You can provide the kubelet with default values to be used by `kubeadm init` and `kubeadm join`
39-
commands. Interesting examples include using a different CRI runtime or setting the default subnet
39+
commands. Interesting examples include using a different container runtime or setting the default subnet
4040
used by services.
4141

4242
If you want your services to use the subnet `10.96.0.0/12` as the default for services, you can pass
@@ -51,7 +51,7 @@ by the kubelet, using the `--cluster-dns` flag. This setting needs to be the sam
5151
on every manager and Node in the cluster. The kubelet provides a versioned, structured API object
5252
that can configure most parameters in the kubelet and push out this configuration to each running
5353
kubelet in the cluster. This object is called
54-
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/).
54+
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/).
5555
The `KubeletConfiguration` allows the user to specify flags such as the cluster DNS IP addresses expressed as
5656
a list of values to a camelCased key, illustrated by the following example:
5757

@@ -78,14 +78,12 @@ networking, or other host-specific parameters. The following list provides a few
7878
unless you are using a cloud provider. You can use the `--hostname-override` flag to override the
7979
default behavior if you need to specify a Node name different from the machine's hostname.
8080

81-
- Currently, the kubelet cannot automatically detect the cgroup driver used by the CRI runtime,
82-
but the value of `--cgroup-driver` must match the cgroup driver used by the CRI runtime to ensure
81+
- Currently, the kubelet cannot automatically detect the cgroup driver used by the container runtime,
82+
but the value of `--cgroup-driver` must match the cgroup driver used by the container runtime to ensure
8383
the health of the kubelet.
8484

85-
- Depending on the CRI runtime your cluster uses, you may need to specify different flags to the kubelet.
86-
For instance, when using Docker, you need to specify flags such as `--network-plugin=cni`, but if you
87-
are using an external runtime, you need to specify `--container-runtime=remote` and specify the CRI
88-
endpoint using the `--container-runtime-endpoint=<path>`.
85+
- To specify the container runtime you must set its endpoint with the
86+
`--container-runtime-endpoint=<path>` flag.
8987

9088
You can specify these flags by configuring an individual kubelet's configuration in your service manager,
9189
such as systemd.
@@ -123,7 +121,7 @@ KUBELET_KUBEADM_ARGS="--flag1=value1 --flag2=value2 ..."
123121
```
124122

125123
In addition to the flags used when starting the kubelet, the file also contains dynamic
126-
parameters such as the cgroup driver and whether to use a different CRI runtime socket
124+
parameters such as the cgroup driver and whether to use a different container runtime socket
127125
(`--cri-socket`).
128126

129127
After marshalling these two files to disk, kubeadm attempts to run the following two

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

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ and investigating each container by running `docker logs`. For other container r
9797

9898
## kubeadm blocks when removing managed containers
9999

100-
The following could happen if Docker halts and does not remove any Kubernetes-managed containers:
100+
The following could happen if the container runtime halts and does not remove
101+
any Kubernetes-managed containers:
101102

102103
```shell
103104
sudo kubeadm reset
@@ -111,18 +112,9 @@ sudo kubeadm reset
111112
(block)
112113
```
113114

114-
A possible solution is to restart the Docker service and then re-run `kubeadm reset`:
115-
116-
```shell
117-
sudo systemctl restart docker.service
118-
sudo kubeadm reset
119-
```
120-
121-
Inspecting the logs for docker may also be useful:
122-
123-
```shell
124-
journalctl -u docker
125-
```
115+
A possible solution is to restart the container runtime and then re-run `kubeadm reset`.
116+
You can also use `crictl` to debug the state of the container runtime. See
117+
[Debugging Kubernetes nodes with crictl](/docs/tasks/debug-application-cluster/crictl/).
126118

127119
## Pods in `RunContainerError`, `CrashLoopBackOff` or `Error` state
128120

@@ -136,10 +128,6 @@ Right after `kubeadm init` there should not be any pods in these states.
136128
it's very likely that the Pod Network add-on that you installed is somehow broken.
137129
You might have to grant it more RBAC privileges or use a newer version. Please file
138130
an issue in the Pod Network providers' issue tracker and get the issue triaged there.
139-
- If you install a version of Docker older than 1.12.1, remove the `MountFlags=slave` option
140-
when booting `dockerd` with `systemd` and restart `docker`. You can see the MountFlags in `/usr/lib/systemd/system/docker.service`.
141-
MountFlags can interfere with volumes mounted by Kubernetes, and put the Pods in `CrashLoopBackOff` state.
142-
The error happens when Kubernetes does not find `var/run/secrets/kubernetes.io/serviceaccount` files.
143131

144132
## `coredns` is stuck in the `Pending` state
145133

content/en/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ in the `flannel-host-gw.yml` or `flannel-overlay.yml` file and specify your inte
136136
curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/flannel-overlay.yml | sed 's/Ethernet/Ethernet0 2/g' | kubectl apply -f -
137137
```
138138
{{< /note >}}
139-
139+
140140

141141

142142
### Joining a Windows worker node
@@ -147,33 +147,7 @@ with elevated permissions (Administrator) on the Windows worker node.
147147
{{< /note >}}
148148

149149
{{< tabs name="tab-windows-kubeadm-runtime-installation" >}}
150-
{{% tab name="Docker EE" %}}
151-
152-
#### Install Docker EE
153-
154-
Install the `Containers` feature
155-
156-
```powershell
157-
Install-WindowsFeature -Name containers
158-
```
159150

160-
Install Docker
161-
Instructions to do so are available at [Install Docker Engine - Enterprise on Windows Servers](https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server#install-docker).
162-
163-
#### Install wins, kubelet, and kubeadm
164-
165-
```PowerShell
166-
curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
167-
.\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}}
168-
```
169-
170-
#### Run `kubeadm` to join the node
171-
172-
Use the command that was given to you when you ran `kubeadm init` on a control plane host.
173-
If you no longer have this command, or the token has expired, you can run `kubeadm token create --print-join-command`
174-
(on a control plane host) to generate a new token and join command.
175-
176-
{{% /tab %}}
177151
{{% tab name="CRI-containerD" %}}
178152

179153
#### Install containerD
@@ -191,9 +165,6 @@ To install a specific version of containerD specify the version with -ContainerD
191165
.\Install-Containerd.ps1 -ContainerDVersion 1.4.1
192166
```
193167

194-
{{< /note >}}
195-
196-
{{< note >}}
197168
If you're using a different interface rather than Ethernet (i.e. "Ethernet0 2") on the Windows nodes, specify the name with `-netAdapterName`.
198169
199170
```powershell
@@ -210,17 +181,59 @@ curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools
210181
.\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}} -ContainerRuntime containerD
211182
```
212183
184+
[Install `crictl` from the cri-tools package](https://github.com/kubernetes-sigs/cri-tools)
185+
which is required so that kubeadm can talk to the CRI endpoint.
186+
213187
#### Run `kubeadm` to join the node
214188
215189
Use the command that was given to you when you ran `kubeadm init` on a control plane host.
216190
If you no longer have this command, or the token has expired, you can run `kubeadm token create --print-join-command`
217191
(on a control plane host) to generate a new token and join command.
218192
193+
{{% /tab %}}
194+
195+
{{% tab name="Docker Engine" %}}
196+
197+
#### Install Docker Engine
198+
199+
Install the `Containers` feature
200+
201+
```powershell
202+
Install-WindowsFeature -Name containers
203+
```
204+
205+
Install Docker
206+
Instructions to do so are available at [Install Docker Engine - Enterprise on Windows Servers](https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server#install-docker).
207+
208+
[Install cri-dockerd](https://github.com/Mirantis/cri-dockerd) which is required so that the kubelet
209+
can communicate with Docker on a CRI compatible endpoint.
210+
219211
{{< note >}}
220-
If using **CRI-containerD** add `--cri-socket "npipe:////./pipe/containerd-containerd"` to the kubeadm call
212+
Docker Engine does not implement the [CRI](/docs/concepts/architecture/cri/)
213+
which is a requirement for a container runtime to work with Kubernetes.
214+
For that reason, an additional service [cri-dockerd](https://github.com/Mirantis/cri-dockerd)
215+
has to be installed. cri-dockerd is a project based on the legacy built-in
216+
Docker Engine support that was [removed](/dockershim) from the kubelet in version 1.24.
221217
{{< /note >}}
222218
219+
Install `crictl` from the [cri-tools project](https://github.com/kubernetes-sigs/cri-tools)
220+
which is required so that kubeadm can talk to the CRI endpoint.
221+
222+
#### Install wins, kubelet, and kubeadm
223+
224+
```PowerShell
225+
curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
226+
.\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}}
227+
```
228+
229+
#### Run `kubeadm` to join the node
230+
231+
Use the command that was given to you when you ran `kubeadm init` on a control plane host.
232+
If you no longer have this command, or the token has expired, you can run `kubeadm token create --print-join-command`
233+
(on a control plane host) to generate a new token and join command.
234+
223235
{{% /tab %}}
236+
224237
{{< /tabs >}}
225238
226239
### Verifying your installation

0 commit comments

Comments
 (0)