Skip to content

Kubernetes ConfigMap Sink

varTrack writes config values directly into a Kubernetes ConfigMap. Changes pushed to Git are reflected in the cluster automatically — no manual kubectl apply needed.


Configuration

datasources: [{
  configmap: {
    tag:        ""
    namespace:  "default"
    kubeconfig_path: "/path/to/kubeconfig"    // optional — uses in-cluster config if omitted
  }
}]

Orchestrator image

This sink needs the Kubernetes Python client, which the orchestrator image leaves out by default. Build it with --build-arg KUBERNETES_CLIENT=kubernetes==31.0.0.

Destination template

The destination_template controls the ConfigMap name:

rules: [{
  platform:             "github"
  datasource:           "configmap"
  file_name:           "app-settings.yaml"
  branch_map:           {main: "production"}
  destination_template: "myapp-{env}"
}]
Push branch ConfigMap created/updated
main myapp-production
develop myapp-staging

Config keys are stored as ConfigMap data entries:

apiVersion: v1
kind: ConfigMap
metadata:
  name: myapp-production
  namespace: default
data:
  database.host: "mongo.prod.internal"
  max_connections: "50"
  feature.dark_mode: "true"

Drift detection

The watcher asks the orchestrator each poll; the orchestrator reads the ConfigMap's data and compares it with what it last synced from Git — a changed or missing key is drift (Drift Detection).

rules: [{
  platform:   "github"
  datasource: "configmap"
  file_name: "app-settings.yaml"
  branch_map: {main: "production"}
  self_heal:  true
}]