kube-image-keeper
kube-image-keeper copied to clipboard
Registry with PVC should run as a Deployment
When the registry is configured with filesystem persistence, it should not run as a StatefulSet but as a Deployment just like the stateless mode.
In this persistence mode, the registry is not a scalable resource and only one Pod and it's PVC can run. Relying on a StatefulSet is dangerous as this controller makes decisions that do not favor availability, and is incompatible with a pet Pod critical to the cluster. For example if a Node is shut down or crashes while not being drained, the registry replica will be stuck in the Terminating state and not rescheduled in the cluster, amplifying the incident.
Running as a Deployment with spec.strategy.type: Recreate would allow the registry to quickly recover. The CSI driver will take care of the multi-attachment protection and volume fencing.
@npdgm you don't need to set spec.strategy.type: Recreate it is better to set the PVC spec.accessMode to RWX that also will allow to run replicas with the same volume without issues which is supported by the registry