Prune images after successful Kubernetes upgrade #3231
Labels
customer-request
kind/feature
Categorizes issue or PR as related to a new feature.
sig/cluster-management
Denotes a PR or issue as being assigned to SIG Cluster Management.
Milestone
Description of the feature you would like to add / User story
After ~2 Kubernetes version upgrades, we always receive alerts as disk usage has climbed >80% (of 50GB). We then address this by SSHing into all control plane nodes and executing
sudo crictl rmi --prune
to delete unused images, bringing us down to ~40% usage.It would be nice if we could tell kubeone, probably with a flag, to prune the images on all control plane nodes after the control plane has been upgraded. It's not super elaborate to do it by hand, but it would be a quality of life improvement. The actual cleanup isn't even the "hard" task, but the alert that fires first is often something unrelated (e.g. node-exporter running out of disk space) and thus it first takes a bit of investigation.
With a
--prune-images
flag, we'd just add that to our pipeline job and wouldn't have to care about it anymore.Solution details
Add a flag, such as
--prune-images
, to thekubeone
CLI that runssudo crictl rmi --prune
on each control plane node after the upgrade (either on that node or of the whole cluster - you're probably the better judge of that). I guess ideally it could also be used to prune images even when no upgrade is performed, in case people want to run it separately after the upgrade was done.Alternative approaches
SSH into each control plane node and execute the command manually.
Use cases
Additional information
The text was updated successfully, but these errors were encountered: