Skip to content

Commit 572f444

Browse files
committed
[zh] Sync administer-cluster/kubelet-config-file.md
1 parent 26830bf commit 572f444

File tree

1 file changed

+147
-147
lines changed

1 file changed

+147
-147
lines changed

content/zh-cn/docs/tasks/administer-cluster/kubelet-config-file.md

Lines changed: 147 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ In this example, the kubelet is configured with the following settings:
8787
8888
<!--
8989
1. `address`: The kubelet will serve on IP address `192.168.0.8`.
90-
2. `port`: The kubelet will serve on port `20250`.
91-
3. `serializeImagePulls`: Image pulls will be done in parallel.
92-
4. `evictionHard`: The kubelet will evict Pods under one of the following conditions:
90+
1. `port`: The kubelet will serve on port `20250`.
91+
1. `serializeImagePulls`: Image pulls will be done in parallel.
92+
1. `evictionHard`: The kubelet will evict Pods under one of the following conditions:
93+
9394
- When the node's available memory drops below 100MiB.
9495
- When the node's main filesystem's available space is less than 10%.
9596
- When the image filesystem's available space is less than 15%.
@@ -218,10 +219,9 @@ However, it's important to note that the behavior varies based on the data type
218219
但是,请务必注意,产生的行为会根据配置字段的数据类型而有所不同。
219220

220221
<!--
221-
Different data types in the kubelet configuration structure merge differently.
222-
See the [reference
223-
document](/docs/reference/node/kubelet-config-directory-merging.md) for more
224-
information.
222+
Different data types in the kubelet configuration structure merge differently. See the
223+
[reference document](/docs/reference/node/kubelet-config-directory-merging.md)
224+
for more information.
225225
-->
226226
kubelet 配置结构中不同数据类型的合并方式不同。
227227
有关详细信息,请参阅[参考文档](/zh-cn/docs/reference/node/kubelet-config-directory-merging.md)。
@@ -249,8 +249,9 @@ On startup, the kubelet merges configuration from:
249249
{{< note >}}
250250
<!--
251251
The config drop-in dir mechanism for the kubelet is similar but different from how the `kubeadm` tool allows you to patch configuration.
252-
The `kubeadm` tool uses a specific [patching strategy](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/#patches) for its configuration,
253-
whereas the only patch strategy for kubelet configuration drop-in files is `replace`. The kubelet determines the order of merges based on sorting the **suffixes** alphanumerically,
252+
The `kubeadm` tool uses a specific [patching strategy](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/#patches)
253+
for its configuration, whereas the only patch strategy for kubelet configuration drop-in files is `replace`.
254+
The kubelet determines the order of merges based on sorting the **suffixes** alphanumerically,
254255
and replaces every field present in a higher priority file.
255256
-->
256257
kubelet 的配置插件目录机制类似,但与 `kubeadm` 工具允许 patch 配置的方式不同。
@@ -276,152 +277,151 @@ they can follow these steps to inspect the kubelet configuration:
276277
-->
277278
1. 在终端中使用 [`kubectl proxy`](/docs/reference/kubectl/generated/kubectl-commands#proxy) 启动代理服务器。
278279

279-
```bash
280-
kubectl proxy
281-
```
280+
```bash
281+
kubectl proxy
282+
```
282283

283-
<!--
284-
Which gives output like:
285-
-->
286-
其输出如下:
284+
<!--
285+
Which gives output like:
286+
-->
287+
其输出如下:
287288

288-
```bash
289-
Starting to serve on 127.0.0.1:8001
290-
291-
```
289+
```none
290+
Starting to serve on 127.0.0.1:8001
291+
```
292292

293293
<!--
294-
2. Open another terminal window and use `curl` to fetch the kubelet configuration.
295-
Replace `<node-name>` with the actual name of your node:
294+
1. Open another terminal window and use `curl` to fetch the kubelet configuration.
295+
Replace `<node-name>` with the actual name of your node:
296296
-->
297297
2. 打开另一个终端窗口并使用 `curl` 来获取 kubelet 配置。
298298
将 `<node-name>` 替换为节点的实际名称:
299299

300-
```bash
301-
curl -X GET http://127.0.0.1:8001/api/v1/nodes/<node-name>/proxy/configz | jq .
302-
```
303-
304-
```bash
305-
{
306-
"kubeletconfig": {
307-
"enableServer": true,
308-
"staticPodPath": "/var/run/kubernetes/static-pods",
309-
"syncFrequency": "1m0s",
310-
"fileCheckFrequency": "20s",
311-
"httpCheckFrequency": "20s",
312-
"address": "192.168.1.16",
313-
"port": 10250,
314-
"readOnlyPort": 10255,
315-
"tlsCertFile": "/var/lib/kubelet/pki/kubelet.crt",
316-
"tlsPrivateKeyFile": "/var/lib/kubelet/pki/kubelet.key",
317-
"rotateCertificates": true,
318-
"authentication": {
319-
"x509": {
320-
"clientCAFile": "/var/run/kubernetes/client-ca.crt"
321-
},
322-
"webhook": {
323-
"enabled": true,
324-
"cacheTTL": "2m0s"
325-
},
326-
"anonymous": {
327-
"enabled": true
328-
}
329-
},
330-
"authorization": {
331-
"mode": "AlwaysAllow",
332-
"webhook": {
333-
"cacheAuthorizedTTL": "5m0s",
334-
"cacheUnauthorizedTTL": "30s"
335-
}
336-
},
337-
"registryPullQPS": 5,
338-
"registryBurst": 10,
339-
"eventRecordQPS": 50,
340-
"eventBurst": 100,
341-
"enableDebuggingHandlers": true,
342-
"healthzPort": 10248,
343-
"healthzBindAddress": "127.0.0.1",
344-
"oomScoreAdj": -999,
345-
"clusterDomain": "cluster.local",
346-
"clusterDNS": [
347-
"10.0.0.10"
348-
],
349-
"streamingConnectionIdleTimeout": "4h0m0s",
350-
"nodeStatusUpdateFrequency": "10s",
351-
"nodeStatusReportFrequency": "5m0s",
352-
"nodeLeaseDurationSeconds": 40,
353-
"imageMinimumGCAge": "2m0s",
354-
"imageMaximumGCAge": "0s",
355-
"imageGCHighThresholdPercent": 85,
356-
"imageGCLowThresholdPercent": 80,
357-
"volumeStatsAggPeriod": "1m0s",
358-
"cgroupsPerQOS": true,
359-
"cgroupDriver": "systemd",
360-
"cpuManagerPolicy": "none",
361-
"cpuManagerReconcilePeriod": "10s",
362-
"memoryManagerPolicy": "None",
363-
"topologyManagerPolicy": "none",
364-
"topologyManagerScope": "container",
365-
"runtimeRequestTimeout": "2m0s",
366-
"hairpinMode": "promiscuous-bridge",
367-
"maxPods": 110,
368-
"podPidsLimit": -1,
369-
"resolvConf": "/run/systemd/resolve/resolv.conf",
370-
"cpuCFSQuota": true,
371-
"cpuCFSQuotaPeriod": "100ms",
372-
"nodeStatusMaxImages": 50,
373-
"maxOpenFiles": 1000000,
374-
"contentType": "application/vnd.kubernetes.protobuf",
375-
"kubeAPIQPS": 50,
376-
"kubeAPIBurst": 100,
377-
"serializeImagePulls": true,
378-
"evictionHard": {
379-
"imagefs.available": "15%",
380-
"memory.available": "100Mi",
381-
"nodefs.available": "10%",
382-
"nodefs.inodesFree": "5%"
383-
},
384-
"evictionPressureTransitionPeriod": "1m0s",
385-
"enableControllerAttachDetach": true,
386-
"makeIPTablesUtilChains": true,
387-
"iptablesMasqueradeBit": 14,
388-
"iptablesDropBit": 15,
389-
"featureGates": {
390-
"AllAlpha": false
391-
},
392-
"failSwapOn": false,
393-
"memorySwap": {},
394-
"containerLogMaxSize": "10Mi",
395-
"containerLogMaxFiles": 5,
396-
"configMapAndSecretChangeDetectionStrategy": "Watch",
397-
"enforceNodeAllocatable": [
398-
"pods"
399-
],
400-
"volumePluginDir": "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
401-
"logging": {
402-
"format": "text",
403-
"flushFrequency": "5s",
404-
"verbosity": 3,
405-
"options": {
406-
"json": {
407-
"infoBufferSize": "0"
408-
}
409-
}
410-
},
411-
"enableSystemLogHandler": true,
412-
"enableSystemLogQuery": false,
413-
"shutdownGracePeriod": "0s",
414-
"shutdownGracePeriodCriticalPods": "0s",
415-
"enableProfilingHandler": true,
416-
"enableDebugFlagsHandler": true,
417-
"seccompDefault": false,
418-
"memoryThrottlingFactor": 0.9,
419-
"registerNode": true,
420-
"localStorageCapacityIsolation": true,
421-
"containerRuntimeEndpoint": "unix:///var/run/crio/crio.sock"
422-
}
423-
}
424-
```
300+
```bash
301+
curl -X GET http://127.0.0.1:8001/api/v1/nodes/<node-name>/proxy/configz | jq .
302+
```
303+
304+
```json
305+
{
306+
"kubeletconfig": {
307+
"enableServer": true,
308+
"staticPodPath": "/var/run/kubernetes/static-pods",
309+
"syncFrequency": "1m0s",
310+
"fileCheckFrequency": "20s",
311+
"httpCheckFrequency": "20s",
312+
"address": "192.168.1.16",
313+
"port": 10250,
314+
"readOnlyPort": 10255,
315+
"tlsCertFile": "/var/lib/kubelet/pki/kubelet.crt",
316+
"tlsPrivateKeyFile": "/var/lib/kubelet/pki/kubelet.key",
317+
"rotateCertificates": true,
318+
"authentication": {
319+
"x509": {
320+
"clientCAFile": "/var/run/kubernetes/client-ca.crt"
321+
},
322+
"webhook": {
323+
"enabled": true,
324+
"cacheTTL": "2m0s"
325+
},
326+
"anonymous": {
327+
"enabled": true
328+
}
329+
},
330+
"authorization": {
331+
"mode": "AlwaysAllow",
332+
"webhook": {
333+
"cacheAuthorizedTTL": "5m0s",
334+
"cacheUnauthorizedTTL": "30s"
335+
}
336+
},
337+
"registryPullQPS": 5,
338+
"registryBurst": 10,
339+
"eventRecordQPS": 50,
340+
"eventBurst": 100,
341+
"enableDebuggingHandlers": true,
342+
"healthzPort": 10248,
343+
"healthzBindAddress": "127.0.0.1",
344+
"oomScoreAdj": -999,
345+
"clusterDomain": "cluster.local",
346+
"clusterDNS": [
347+
"10.0.0.10"
348+
],
349+
"streamingConnectionIdleTimeout": "4h0m0s",
350+
"nodeStatusUpdateFrequency": "10s",
351+
"nodeStatusReportFrequency": "5m0s",
352+
"nodeLeaseDurationSeconds": 40,
353+
"imageMinimumGCAge": "2m0s",
354+
"imageMaximumGCAge": "0s",
355+
"imageGCHighThresholdPercent": 85,
356+
"imageGCLowThresholdPercent": 80,
357+
"volumeStatsAggPeriod": "1m0s",
358+
"cgroupsPerQOS": true,
359+
"cgroupDriver": "systemd",
360+
"cpuManagerPolicy": "none",
361+
"cpuManagerReconcilePeriod": "10s",
362+
"memoryManagerPolicy": "None",
363+
"topologyManagerPolicy": "none",
364+
"topologyManagerScope": "container",
365+
"runtimeRequestTimeout": "2m0s",
366+
"hairpinMode": "promiscuous-bridge",
367+
"maxPods": 110,
368+
"podPidsLimit": -1,
369+
"resolvConf": "/run/systemd/resolve/resolv.conf",
370+
"cpuCFSQuota": true,
371+
"cpuCFSQuotaPeriod": "100ms",
372+
"nodeStatusMaxImages": 50,
373+
"maxOpenFiles": 1000000,
374+
"contentType": "application/vnd.kubernetes.protobuf",
375+
"kubeAPIQPS": 50,
376+
"kubeAPIBurst": 100,
377+
"serializeImagePulls": true,
378+
"evictionHard": {
379+
"imagefs.available": "15%",
380+
"memory.available": "100Mi",
381+
"nodefs.available": "10%",
382+
"nodefs.inodesFree": "5%"
383+
},
384+
"evictionPressureTransitionPeriod": "1m0s",
385+
"enableControllerAttachDetach": true,
386+
"makeIPTablesUtilChains": true,
387+
"iptablesMasqueradeBit": 14,
388+
"iptablesDropBit": 15,
389+
"featureGates": {
390+
"AllAlpha": false
391+
},
392+
"failSwapOn": false,
393+
"memorySwap": {},
394+
"containerLogMaxSize": "10Mi",
395+
"containerLogMaxFiles": 5,
396+
"configMapAndSecretChangeDetectionStrategy": "Watch",
397+
"enforceNodeAllocatable": [
398+
"pods"
399+
],
400+
"volumePluginDir": "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
401+
"logging": {
402+
"format": "text",
403+
"flushFrequency": "5s",
404+
"verbosity": 3,
405+
"options": {
406+
"json": {
407+
"infoBufferSize": "0"
408+
}
409+
}
410+
},
411+
"enableSystemLogHandler": true,
412+
"enableSystemLogQuery": false,
413+
"shutdownGracePeriod": "0s",
414+
"shutdownGracePeriodCriticalPods": "0s",
415+
"enableProfilingHandler": true,
416+
"enableDebugFlagsHandler": true,
417+
"seccompDefault": false,
418+
"memoryThrottlingFactor": 0.9,
419+
"registerNode": true,
420+
"localStorageCapacityIsolation": true,
421+
"containerRuntimeEndpoint": "unix:///var/run/crio/crio.sock"
422+
}
423+
}
424+
```
425425

426426
<!-- discussion -->
427427

0 commit comments

Comments
 (0)