Question: 1
Create a configmap called myconfigmap with literal value
appname=myapp
Question: 2
Create a file called ''config.txt'' with two values key1=value1
and key2=value2. Then create a configmap named ''keyvalcfgmap'' andread data from the file ''config.txt'' and verify that configmap is
created correctly
Question: 3
Create an nginx pod and load environment values from the above configmap "keyvalcfgmap" and exec into the pod and verify the environment variables and delete the pod
Question: 4
Create a redis pod and mount ''redis-config'' as ''redis.conf''
inside redis container, name the config volume as ''redis-volume''
redis-config path - /opt/redis-config
Question: 5
// Create a configmap
kubectl create configmap redis-config --from-file=/opt/redisconfig
// Verify
kubectl get configmap redis-config -o yaml
// first run this command to save the pod yml
kubectl run redis-pod --image=redis --restart=Always --dry-run
-o yaml > redis-pod.yml
// edit the yml to below file and create
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
env:
- name: MASTER
value: "true"
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /redis-master-data
name: data
- mountPath: /redis-master
name: config
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: example-redis-config