Chapter 6: Configuration and Storage Management in Kubernetes
Activity 6: Updating Configurations on the Fly
Solution:
Perform the following steps to complete this activity:
- We created a ConfigMap named app-config and a secret named token earlier in the chapter. Please include them in your solution. Create a pod definition file that consumes this ConfigMap and the secret:
apiVersion: v1
kind: Pod
metadata:
name: config-secret-pod
spec:
containers:
- name: content
image: busybox
command: [ "sh", "-c"]
args:
- while true; do
echo -en '\n';
echo Current environment is 'cat /configurations/environment';
echo Used token is 'cat /secrets/token';
sleep 10;
done;
volumeMounts:
- name: config-volume
mountPath: "/configurations"
- name: secret-volume
mountPath: "/secrets"
volumes:
- name: config-volume
configMap:
name: app-config
- name: secret-volume...