@@ -190,15 +190,20 @@ for more details.
190
190
191
191
<!--
192
192
When you call `kubeadm init`, the kubelet configuration is marshalled to disk
193
- at `/var/lib/kubelet/config.yaml`, and also uploaded to a `kubelet-config` ConfigMap in the `kube-system`
194
- namespace of the cluster. A kubelet configuration file is also written to `/etc/kubernetes/kubelet.conf`
193
+ at `/var/lib/kubelet/config.yaml`, and also uploaded to a `kubelet-config`
194
+ ConfigMap in the `kube-system` namespace of the cluster.
195
+ Additionally, the kubeadm tool detects the CRI socket on the node and writes its details
196
+ (including the socket path) into a local configuration, `/var/lib/kubelet/instance-config.yaml`.
197
+ A kubelet configuration file is also written to `/etc/kubernetes/kubelet.conf`
195
198
with the baseline cluster-wide configuration for all kubelets in the cluster. This configuration file
196
199
points to the client certificates that allow the kubelet to communicate with the API server. This
197
200
addresses the need to
198
201
[propagate cluster-level configuration to each kubelet](#propagating-cluster-level-configuration-to-each-kubelet).
199
202
-->
200
203
当调用 `kubeadm init` 时,kubelet 的配置会被写入磁盘 `/var/lib/kubelet/config.yaml`,
201
204
并上传到集群 `kube-system` 命名空间的 `kubelet-config` ConfigMap。
205
+ 此外,kubeadm 工具会在节点上检测 CRI 套接字,
206
+ 并将其详细信息(包括套接字路径)写入本地配置文件 `/var/lib/kubelet/instance-config.yaml`。
202
207
kubelet 配置信息也被写入 `/etc/kubernetes/kubelet.conf`,其中包含集群内所有 kubelet 的基线配置。
203
208
此配置文件指向允许 kubelet 与 API 服务器通信的客户端证书。
204
209
这解决了[将集群级配置传播到每个 kubelet](#propagating-cluster-level-configuration-to-each-kubelet) 的需求。
@@ -219,11 +224,9 @@ KUBELET_KUBEADM_ARGS="--flag1=value1 --flag2=value2 ..."
219
224
220
225
<!--
221
226
In addition to the flags used when starting the kubelet, the file also contains dynamic
222
- parameters such as the cgroup driver and whether to use a different container runtime socket
223
- (`--cri-socket`).
227
+ parameters such as the cgroup driver.
224
228
-->
225
- 除了启动 kubelet 时所使用的标志外,该文件还包含动态参数,例如 cgroup
226
- 驱动程序以及是否使用其他容器运行时套接字(`--cri-socket`)。
229
+ 除了启动 kubelet 时所使用的标志外,该文件还包含诸如 CGroup 驱动程序等动态参数。
227
230
228
231
<!--
229
232
After marshalling these two files to disk, kubeadm attempts to run the following two
@@ -245,13 +248,17 @@ If the reload and restart are successful, the normal `kubeadm init` workflow con
245
248
246
249
When you run `kubeadm join`, kubeadm uses the Bootstrap Token credential to perform
247
250
a TLS bootstrap, which fetches the credential needed to download the
248
- ` kubelet-config` ConfigMap and writes it to `/var/lib/kubelet/config.yaml`. The dynamic
249
- environment file is generated in exactly the same way as `kubeadm init`.
251
+ ` kubelet-config` ConfigMap and writes it to `/var/lib/kubelet/config.yaml`.
252
+ Additionally, the kubeadm tool detects the CRI socket on the node and writes its details
253
+ (including the socket path) into a local configuration, `/var/lib/kubelet/instance-config.yaml`.
254
+ The dynamic environment file is generated in exactly the same way as `kubeadm init`.
250
255
-->
251
256
# ## 使用 `kubeadm join` 时的工作流程 {#workflow-when-using-kubeadm-join}
252
257
253
258
当运行 `kubeadm join` 时,kubeadm 使用 Bootstrap Token 证书执行 TLS 引导,该引导会获取一份证书,
254
259
该证书需要下载 `kubelet-config` ConfigMap 并把它写入 `/var/lib/kubelet/config.yaml` 中。
260
+ 此外,kubeadm 会在节点上自动检测 CRI 套接字,
261
+ 并将其详细信息(包括套接字路径)写入本地配置文件 `/var/lib/kubelet/instance-config.yaml`。
255
262
动态环境文件的生成方式恰好与 `kubeadm init` 完全相同。
256
263
257
264
<!--
0 commit comments