Skip to content

magmax/configsyncop

Repository files navigation

Kubernetes Configuration Sync Operator

An operator to safely restart pods when configuration changes.

How it works

Configsyncop will watch your configmaps and secrets. If any annotated secret/configmap is modified, it will perform a rollout for any deployment, daemonset or statefulset using that secret/configmap.

Installation

  1. Install RBAC permissions: kubectl apply -f rbac.yaml
  2. Install main operator: kubectl apply -f deployment.yaml

Usage

  1. Annotate your configmaps or secrets with k8s.config.sync.manage: "true".
  2. Annotate your namespaces with k8s.config.sync.manage/Secret: "true" and/or k8s.config.sync.manage/ConfigMap: "true" to manage all Secrets or ConfigMaps in that namespace.

Examples

The folder example contains dummy secrets and configmaps. Just install them:

kubectl apply -f example/secret.yaml
kubectl apply -f example/configmap.yaml

Then you can install the deployments, daemonsets or statefulsets you want. There are four flavours:

  • *-env-secret.yaml: uses the secret as an environment variable.
  • *-volume-secret.yaml: uses the secret as a volume.
  • *-env-cm.yaml: uses the configmap as an environment variable.
  • *-volume-cm.yaml: uses the configmap as a volume.

Monitoring

Automatically exposes Prometheus metrics on port 9090.