<p>I am running a managed kubernetes cluster on Google Cloud Platform with a single node for development.</p>

<p>However when I update Pod images too frequently, the ImagePull step fails due to insufficient disk space in the boot disk.</p>

<p>I noticed that images should be auto GC-ed according to documentation, but I have no idea what is the setting on GKE or how to change it.</p>

<p><a href="https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/#image-collection" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/#image-collection</a></p>

<ol>
<li>Can I manually trigger a unused image clean up, using <code>kubectl</code> or Google Cloud console command?</li>
<li>How do I check/change the above GC setting above such that I wont encounter this issue in the future?</li>
</ol>

William Chong
<p>Since Garbage Collector is an automated service, there are no kubectl commands or any other commands within GCP to manually trigger Garbage Collector.</p>

<p>In regards to your second inquiry, Garbage Collector is handled by the Master node. The Master node is not accessible to users since it is a managed service. As such, users cannot configure Garbage Collection withing GKE.</p>

<p>The only workaround I can offer is to <a href="https://kubernetes.io/docs/setup/scratch/" rel="nofollow noreferrer">create a custom cluster from scratch</a> within Google Compute Engine. This would provide you access to the Master node of your cluster so you can have the flexibility of configuring the cluster to your liking.</p>

<p>Edit: If you need to delete old images, I would suggest removing the old images using docker commands. I have attached a github article that provides several different commands that you can run on the node level to remove old images <a href="https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430" rel="nofollow noreferrer">here</a>.</p>
