E235
E235

Reputation: 13440

How to reduce the DiskPressure condition threshold of a node

I want to reduce the DiskPressure limit. After reading Kubernetes documentation (also on this GitHub case), I understand that because of nodefs.available<10% I must have my volume free space more than 10%.

I want to change it to 5% but I don't understand how.

I read here and in the node condition by Kubernetes, they mention these flag --eviction-hard or eviction-soft that might be the solution but where should I changed them?

I am using Kubelet config file on the worker node:

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  

I don't understand what I should change. Most of these settings are seconds (0s).
How can I reduce the threshold?

Upvotes: 1

Views: 2128

Answers (1)

Olesya Bolobova
Olesya Bolobova

Reputation: 1653

This used to be kubelet command line arg.
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.

Now it should be specified thru kubelet config file - you were on the right way :)
Just add required entries to your config.

evictionHard:
  nodefs.available: 5%

Config schema.
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubelet/config/v1beta1/types.go#L571

Upvotes: 4

Related Questions