accessing kubelet settings on gke to fix nodeHasDiskPressure

3/6/2018

Everytime I make a new deployment of my app, my nodes start reporting nodeHasDiskPressure . After around 10 minutes or so the node goes back to a normal state. I found this SO answer regarding setting thresholds: DiskPressure crashing the node

.. but I am not sure how to actually set these thresholds on Google Kubernetes Engine

-- snowflakekiller
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

3/8/2018

The kubelet option you mentioned can be added to you cluster "instance-template"

Make a copy of the instance-template that has been used for your cluster (instance-group) after clicked on copy before to save you can make some changes at the instance template,you can add those flags into : Instance-template --> Custom metadata--> kube-env

The flag will be added in this way;

KUBELET_TEST_ARGS: --image-gc-high-threshold=[your value] KUBELET_TEST_ARGS: --low-diskspace-threshold-mb=[your value] KUBELET_TEST_ARGS: --image-gc-low-threshold=[your value]

Once you set your values,save the instance template then edit the instance group of your cluster by changing the instance-template from the default to your custom one, once done it hit "rolling restart/replace" on your Dashboard on the instance group main page. This will restart your instances of your cluster with the new values.

-- Alessio
Source: StackOverflow