A sample documentation ( http://kubernetes.io/docs/user-guide/configmap/ ) for consuming values ββis based on ConfigMap, where each data item represents one pair / value, Example:
apiVersion: v1 kind: ConfigMap metadata: name: special-config namespace: default data: special.how: very special.type: charm
However, when we create a ConfigMap from property files, each data entry value is a list of key / pair values. Example:
$ kubectl get configmaps game-config -o yaml apiVersion: v1 kind: ConfigMap metadata: name: game-config [...] data: game.properties: |- enemies=aliens lives=3 enemies.cheat=true enemies.cheat.level=noGoodRotten secret.code.passphrase=UUDDLRLRBABAS secret.code.allowed=true secret.code.lives=30 [...]
In this case:
- How do we use one record (for example: enemy.cheat) as an environment variable?
- How do we use all records (for example: all game.properties records) as a set of environment variables, assuming we just use each key as the name of an environment variable?
source share