如何降低节点的DiskPressure条件阈值
How to reduce the DiskPressure condition threshold of a node
我想减少 DiskPressure
限制。阅读 Kubernetes documentation (also on this GitHub case) 后,我明白由于 nodefs.available<10%
我必须让我的音量 space 超过 10%。
我想将其更改为 5%,但我不知道如何更改。
我读了 and in the node condition by Kubernetes,他们提到这些标志 --eviction-hard
或 eviction-soft
可能是解决方案,但我应该在哪里更改它们?
我在工作节点上使用 Kubelet 配置文件:
root@worker:/# cat /var/lib/kubelet/config.yaml
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
anonymous:
enabled: true
webhook:
cacheTTL: 0s
enabled: true
x509:
clientCAFile: /etc/kubernetes/pki/ca.crt
authorization:
mode: AlwaysAllow
#mode: Webhook
webhook:
cacheAuthorizedTTL: 0s
cacheUnauthorizedTTL: 0s
readOnlyPort: 10255
clusterDNS:
- 10.96.0.10
clusterDomain: cluster.local
cpuManagerReconcilePeriod: 0s
evictionPressureTransitionPeriod: 0s
fileCheckFrequency: 0s
healthzBindAddress: 127.0.0.1
healthzPort: 10248
httpCheckFrequency: 0s
imageMinimumGCAge: 0s
kind: KubeletConfiguration
nodeStatusReportFrequency: 0s
nodeStatusUpdateFrequency: 0s
rotateCertificates: true
runtimeRequestTimeout: 0s
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 0s
syncFrequency: 0s
volumeStatsAggPeriod: 0s
我不明白我应该改变什么。大多数这些设置都是秒 (0s
)。
如何降低门槛?
这曾经是 kubelet 命令行参数。
https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
--eviction-hard mapStringString
A set of eviction thresholds (e.g. memory.available<1Gi
) that if met
would trigger a pod eviction.
DEPRECATED:
This parameter should be
set via the config file specified by the Kubelet's --config
flag.
See
https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/
for more information.
现在它应该通过 kubelet 配置文件指定 - 你是对的:)
只需将所需的条目添加到您的配置中。
evictionHard:
nodefs.available: 5%
我想减少 DiskPressure
限制。阅读 Kubernetes documentation (also on this GitHub case) 后,我明白由于 nodefs.available<10%
我必须让我的音量 space 超过 10%。
我想将其更改为 5%,但我不知道如何更改。
我读了 --eviction-hard
或 eviction-soft
可能是解决方案,但我应该在哪里更改它们?
我在工作节点上使用 Kubelet 配置文件:
root@worker:/# cat /var/lib/kubelet/config.yaml
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
anonymous:
enabled: true
webhook:
cacheTTL: 0s
enabled: true
x509:
clientCAFile: /etc/kubernetes/pki/ca.crt
authorization:
mode: AlwaysAllow
#mode: Webhook
webhook:
cacheAuthorizedTTL: 0s
cacheUnauthorizedTTL: 0s
readOnlyPort: 10255
clusterDNS:
- 10.96.0.10
clusterDomain: cluster.local
cpuManagerReconcilePeriod: 0s
evictionPressureTransitionPeriod: 0s
fileCheckFrequency: 0s
healthzBindAddress: 127.0.0.1
healthzPort: 10248
httpCheckFrequency: 0s
imageMinimumGCAge: 0s
kind: KubeletConfiguration
nodeStatusReportFrequency: 0s
nodeStatusUpdateFrequency: 0s
rotateCertificates: true
runtimeRequestTimeout: 0s
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 0s
syncFrequency: 0s
volumeStatsAggPeriod: 0s
我不明白我应该改变什么。大多数这些设置都是秒 (0s
)。
如何降低门槛?
这曾经是 kubelet 命令行参数。
https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
--eviction-hard mapStringString
A set of eviction thresholds (e.g.memory.available<1Gi
) that if met would trigger a pod eviction.DEPRECATED:
This parameter should be set via the config file specified by the Kubelet's--config
flag.
See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
现在它应该通过 kubelet 配置文件指定 - 你是对的:)
只需将所需的条目添加到您的配置中。
evictionHard:
nodefs.available: 5%