Skip to content

Commit 0135b1b

Browse files
committed
Add documentation for graduating the NodeLocalCRISocket to Beta
1 parent 48f8ce3 commit 0135b1b

File tree

7 files changed

+32
-30
lines changed

7 files changed

+32
-30
lines changed

content/en/docs/reference/labels-annotations-taints/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,18 +2691,18 @@ See more details on [Audit Annotations](/docs/reference/labels-annotations-taint
26912691

26922692
## kubeadm
26932693

2694-
### kubeadm.alpha.kubernetes.io/cri-socket
2694+
### kubeadm.alpha.kubernetes.io/cri-socket (deprecated) {#kubeadm-alpha-kubernetes-io-cri-socket}
26952695

26962696
Type: Annotation
26972697

26982698
Example: `kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/container.sock`
26992699

27002700
Used on: Node
27012701

2702-
Annotation that kubeadm uses to preserve the CRI socket information given to kubeadm at
2703-
`init`/`join` time for later use. kubeadm annotates the Node object with this information.
2704-
The annotation remains "alpha", since ideally this should be a field in KubeletConfiguration
2705-
instead.
2702+
{{< note >}}
2703+
Starting from v1.34, this annotation is deprecated, kubeadm will no longer actively set and use it.
2704+
{{< /note >}}
2705+
27062706

27072707
### kubeadm.kubernetes.io/etcd.advertise-client-urls
27082708

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,10 @@ upgrades the control plane node where it's run. The steps it performs are:
674674
for the kubelet to restart the components if the files have changed.
675675
- Uploads the updated kubeadm and kubelet configurations to the cluster in the `kubeadm-config`
676676
and the `kubelet-config` ConfigMaps (both in the `kube-system` namespace).
677-
- Writes updated kubelet configuration for this node in `/var/lib/kubelet/config.yaml`.
677+
- Writes updated kubelet configuration for this node in `/var/lib/kubelet/config.yaml`,
678+
and read the node's `/var/lib/kubelet/instance-config.yaml` file
679+
and patch fields like `containerRuntimeEndpoint`
680+
from this instance configuration into `/var/lib/kubelet/config.yaml`.
678681
- Configures bootstrap token and the `cluster-info` ConfigMap for RBAC rules. This is the same as
679682
in the `kubeadm init` stage and ensures that the cluster continues to support nodes joining with bootstrap tokens.
680683
- Upgrades the kube-proxy and CoreDNS addons conditionally if all existing kube-apiservers in the cluster
@@ -691,7 +694,10 @@ infers that there is a running kube-apiserver Pod on this node.
691694
- Runs preflight checks similarly to `kubeadm upgrade apply`.
692695
- For control plane nodes, upgrades the control plane manifest files on disk in `/etc/kubernetes/manifests`
693696
and waits for the kubelet to restart the components if the files have changed.
694-
- Writes the updated kubelet configuration for this node in `/var/lib/kubelet/config.yaml`.
697+
- Writes updated kubelet configuration for this node in `/var/lib/kubelet/config.yaml`,
698+
and read the node's `/var/lib/kubelet/instance-config.yaml` file and
699+
patch fields like `containerRuntimeEndpoint`
700+
from this instance configuration into `/var/lib/kubelet/config.yaml`.
695701
- (For control plane nodes) upgrades the kube-proxy and CoreDNS
696702
{{< glossary_tooltip text="addons" term_id="addons" >}} conditionally, provided that all existing
697703
API servers in the cluster have already been upgraded to the target version.

content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ List of feature gates:
156156
Feature | Default | Alpha | Beta | GA
157157
:-------|:--------|:------|:-----|:----
158158
`ControlPlaneKubeletLocalMode` | `true` | 1.31 | 1.33 | -
159-
`NodeLocalCRISocket` | `false` | 1.32 | - | -
159+
`NodeLocalCRISocket` | `true` | 1.32 | 1.34 | -
160160
`WaitForAllControlPlaneComponents` | `true` | 1.30 | 1.33 | 1.34
161161
{{< /table >}}
162162

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,11 @@ for more details.
106106
### Workflow when using `kubeadm init`
107107

108108
When you call `kubeadm init`, the kubelet configuration is marshalled to disk
109-
at `/var/lib/kubelet/config.yaml`, and also uploaded to a `kubelet-config` ConfigMap in the `kube-system`
110-
namespace of the cluster. A kubelet configuration file is also written to `/etc/kubernetes/kubelet.conf`
109+
at `/var/lib/kubelet/config.yaml`, and also uploaded to a `kubelet-config`
110+
ConfigMap in the `kube-system` namespace of the cluster.
111+
Additionally, the kubeadm tool detects the CRI socket on the node and writes its details
112+
(including the socket path) into a local configuration, `/var/lib/kubelet/instance-config.yaml`.
113+
A kubelet configuration file is also written to `/etc/kubernetes/kubelet.conf`
111114
with the baseline cluster-wide configuration for all kubelets in the cluster. This configuration file
112115
points to the client certificates that allow the kubelet to communicate with the API server. This
113116
addresses the need to
@@ -123,8 +126,7 @@ KUBELET_KUBEADM_ARGS="--flag1=value1 --flag2=value2 ..."
123126
```
124127

125128
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 container runtime socket
127-
(`--cri-socket`).
129+
parameters such as the cgroup driver.
128130

129131
After marshalling these two files to disk, kubeadm attempts to run the following two
130132
commands, if you are using systemd:
@@ -139,8 +141,10 @@ If the reload and restart are successful, the normal `kubeadm init` workflow con
139141

140142
When you run `kubeadm join`, kubeadm uses the Bootstrap Token credential to perform
141143
a TLS bootstrap, which fetches the credential needed to download the
142-
`kubelet-config` ConfigMap and writes it to `/var/lib/kubelet/config.yaml`. The dynamic
143-
environment file is generated in exactly the same way as `kubeadm init`.
144+
`kubelet-config` ConfigMap and writes it to `/var/lib/kubelet/config.yaml`.
145+
Additionally, the kubeadm tool detects the CRI socket on the node and writes its details
146+
(including the socket path) into a local configuration, `/var/lib/kubelet/instance-config.yaml`.
147+
The dynamic environment file is generated in exactly the same way as `kubeadm init`.
144148

145149
Next, `kubeadm` runs the following two commands to load the new configuration into the kubelet:
146150

content/en/docs/tasks/administer-cluster/kubeadm/configure-cgroup-driver.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ object under the `kube-system` namespace.
7070
Executing the sub commands `init`, `join` and `upgrade` would result in kubeadm
7171
writing the `KubeletConfiguration` as a file under `/var/lib/kubelet/config.yaml`
7272
and passing it to the local node kubelet.
73+
74+
On each node, kubeadm detects the CRI socket and stores its details into the `/var/lib/kubelet/instance-config.yaml` file.
75+
When executing the `init`, `join`, or `upgrade` subcommands,
76+
kubeadm patches the `containerRuntimeEndpoint` value from this instance configuration into `/var/lib/kubelet/config.yaml`.
7377
{{< /note >}}
7478

7579
## Using the `cgroupfs` driver

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,13 @@ then run the following commands:
101101
Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtime to the flags;
102102
`--container-runtime-endpoint=unix:///run/containerd/containerd.sock`.
103103

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

108-
```shell
109-
kubectl edit no <node-name>
110-
```
111-
112-
This will start a text editor where you can edit the Node object.
113-
To choose a text editor you can set the `KUBE_EDITOR` environment variable.
106+
`/var/lib/kubelet/instance-config.yaml` file on each node. You can create this `/var/lib/kubelet/instance-config.yaml` file on the node.
114107

115-
- Change the value of `kubeadm.alpha.kubernetes.io/cri-socket` from `/var/run/dockershim.sock`
116-
to the CRI socket path of your choice (for example `unix:///run/containerd/containerd.sock`).
117-
118-
Note that new CRI socket paths must be prefixed with `unix://` ideally.
108+
The `/var/lib/kubelet/instance-config.yaml` file allows setting the `containerRuntimeEndpoint` parameter.
119109

120-
- Save the changes in the text editor, which will update the Node object.
110+
You can set this parameter's value to the path of your chosen CRI socket (for example `unix:///run/containerd/containerd.sock`).
121111

122112
## Restart the kubelet
123113

content/en/docs/tasks/debug/debug-cluster/_index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Labels: beta.kubernetes.io/arch=amd64
7171
kubernetes.io/arch=amd64
7272
kubernetes.io/hostname=kube-worker-1
7373
kubernetes.io/os=linux
74-
Annotations: kubeadm.alpha.kubernetes.io/cri-socket: /run/containerd/containerd.sock
7574
node.alpha.kubernetes.io/ttl: 0
7675
volumes.kubernetes.io/controller-managed-attach-detach: true
7776
CreationTimestamp: Thu, 17 Feb 2022 16:46:30 -0500
@@ -144,7 +143,6 @@ apiVersion: v1
144143
kind: Node
145144
metadata:
146145
annotations:
147-
kubeadm.alpha.kubernetes.io/cri-socket: /run/containerd/containerd.sock
148146
node.alpha.kubernetes.io/ttl: "0"
149147
volumes.kubernetes.io/controller-managed-attach-detach: "true"
150148
creationTimestamp: "2022-02-17T21:46:30Z"

0 commit comments

Comments
 (0)