ConfigMaps in K8s

Motivation Container images often accept Environment Variables for configuring their environments, for example the redis image accepts REDIS_VERSION for a specific redis version. Below command starts a redis container, passing a desired REDIS_VERSION environment variable. crictl run -t redis -e REDIS_VERSION=7.2 redis And to start a redis Pod, imperatively: kubectl run --image=redis --env=REDIS_VERSION=7.2 redis And declaratively: apiVersion: v1 kind: Pod metadata: name: redis label: app: kv-store spec: containers: - name: redis image: redis env: - name: REDIS_VERSION value: 7....

February 6, 2024 · 3 min · Aleem Isiaka