enix / kube-image-keeper

kuik is a container image caching system for Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Registry with PVC should run as a Deployment

npdgm opened this issue · comments

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.