Skip to content

Instantly share code, notes, and snippets.

@mbigras
Last active February 8, 2023 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbigras/18c4000ac2ad1c730dc551931bb88b29 to your computer and use it in GitHub Desktop.
Save mbigras/18c4000ac2ad1c730dc551931bb88b29 to your computer and use it in GitHub Desktop.
kind: ConfigMap
apiVersion: v1
metadata:
name: myconfig
data:
HELLO: world
SPAM: eggs
---
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
restartPolicy: Never
containers:
- name: mycontainer
image: registry.k8s.io/busybox
command:
- /bin/echo
- Hello world!
- Env var HELLO is "$HELLO"—surprise!. # Incorrect shell form.
- Env var SPAM is "$(SPAM)"—expected. # Correct $(VAR_NAME) Kubernetes substitution syntax—see https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#use-configmap-defined-environment-variables-in-pod-commands.
envFrom:
- configMapRef:
name: myconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment