How do i change Kubernetes DiskPressure status from true to false?

8/5/2020

After creating a simple nginx deployment, my pod status shows as "PENDING". When I run kubectl get pods command, I get the following:

NAME                                READY   STATUS    RESTARTS   AGE
nginx-deployment-6b474476c4-dq26w   0/1     Pending   0          50m
nginx-deployment-6b474476c4-wjblx   0/1     Pending   0          50m

If I check on my node health, I get:

Taints:             node.kubernetes.io/disk-pressure:NoSchedule
Unschedulable:      false
Lease:
  HolderIdentity:  kubernetes-master
  AcquireTime:     <unset>
  RenewTime:       Wed, 05 Aug 2020 12:43:57 +0530
Conditions:
  Type                 Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----                 ------  -----------------                 ------------------                ------                       -------
  NetworkUnavailable   False   Wed, 05 Aug 2020 09:12:31 +0530   Wed, 05 Aug 2020 09:12:31 +0530   CalicoIsUp                   Calico is running on this node
  MemoryPressure       False   Wed, 05 Aug 2020 12:43:36 +0530   Tue, 04 Aug 2020 23:01:43 +0530   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure         True    Wed, 05 Aug 2020 12:43:36 +0530   Tue, 04 Aug 2020 23:02:06 +0530   KubeletHasDiskPressure       kubelet has disk pressure
  PIDPressure          False   Wed, 05 Aug 2020 12:43:36 +0530   Tue, 04 Aug 2020 23:01:43 +0530   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready                True    Wed, 05 Aug 2020 12:43:36 +0530   Tue, 04 Aug 2020 23:02:06 +0530   KubeletReady                 kubelet is posting ready status. AppArmor enabled
-- manjeet
kubernetes

1 Answer

8/5/2020

You can remove the taint for disk pressure using below command but ideally you need to investigate why kubelet is reporting disk pressure . The node may be out of disk space.

kubectl taint nodes <nodename> node.kubernetes.io/disk-pressure-

This will get you out of pending state of the nginx pods.

-- Arghya Sadhu
Source: StackOverflow