Mini Reloader is a lightweight Kubernetes operator that automatically restarts deployments when their referenced ConfigMaps change.
It ensures your application pods always reflect the latest configuration without manual intervention or GitOps hacks.
-
Event-based ConfigMap watching
-
Auto restarts Deployments referencing changed ConfigMaps
-
Written using Operator SDK and controller-runtime
-
No need for custom resources (CRDs)
-
Can run with minimal RBAC (only needs access to watch & patch Deployments and ConfigMaps)
-
Watches ConfigMaps and Secrets with label
mini-reloader.pelabs/enabled = truein the cluster. -
On change, it:
-
Lists all Deployments in the same namespace.
-
Checks if any of them reference the updated ConfigMap (via volume or envFrom).
-
If match found, patches the Deployment with a new label like:
metadata: labels: restartedAt: <current-time>
-
This triggers a rolling update automatically.
-
-
Support for Secrets also
-
Support StatefulSets and DaemonSets
-
Add support for projected volumes
-
Validate integrity using hashes instead of annotations
-
Expose Prometheus metrics (e.g., restarts triggered)
-
Optional dry-run mode for GitOps-safe environments
-
Multi-namespace or cluster-scoped support
-
Send alerts when restarts are triggered
- go version v1.22.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
docker image build . -t <some-registry>/mini-reloader:tagDeploy operator on a cluster
kubectl apply -f config/mini-reloader-deploy.yaml
kubectl apply -f config/role_binding.yamlTest Operator
kubectl apply -f config/test-deploy.yaml