0
0
Kubernetesdevops~5 mins

Using ConfigMaps as mounted volumes in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a ConfigMap in Kubernetes?
A ConfigMap is a Kubernetes object that stores configuration data as key-value pairs. It helps separate configuration from container images, making apps easier to manage and update.
Click to reveal answer
beginner
How do you use a ConfigMap as a mounted volume in a Pod?
You create a volume in the Pod spec that references the ConfigMap, then mount that volume into a container's file system at a specific path.
Click to reveal answer
intermediate
What happens to the files inside a ConfigMap volume when the ConfigMap is updated?
The files inside the mounted ConfigMap volume are updated automatically within a few seconds, so the container sees the latest config without restarting.
Click to reveal answer
intermediate
Can you mount only specific keys from a ConfigMap as files in a volume?
Yes, you can specify which keys to include or rename them as files using the 'items' field in the volume definition.
Click to reveal answer
beginner
Show a simple YAML snippet to mount a ConfigMap named 'app-config' as a volume at '/etc/config'.
volumes: - name: config-volume configMap: name: app-config containers: - name: app volumeMounts: - name: config-volume mountPath: /etc/config
Click to reveal answer
What is the main purpose of using ConfigMaps as mounted volumes in Kubernetes?
ATo schedule Pods on nodes
BTo store container images
CTo manage network policies
DTo provide configuration files inside containers
Which Kubernetes object do you reference to mount a ConfigMap as a volume?
Asecret volume
BpersistentVolumeClaim
Cvolume with configMap field
DserviceAccount
If you update a ConfigMap, what happens to the mounted files in running Pods?
AThey update automatically after a short delay
BThey never update until Pod restart
CThey update only after deleting the Pod
DThey update only after deleting the ConfigMap
How can you mount only specific keys from a ConfigMap as files?
ACreate a new ConfigMap with only those keys
BUse the 'items' field in the volume config
CUse environment variables only
DMount the entire ConfigMap always
Where do you specify the mount path for a ConfigMap volume inside a container?
AvolumeMounts.mountPath
Bvolumes.path
Ccontainers.image
Dmetadata.name
Explain how to mount a ConfigMap as a volume in a Kubernetes Pod and why this is useful.
Think about separating config from code and how files appear inside containers.
You got /4 concepts.
    Describe what happens when you update a ConfigMap that is mounted as a volume in a running Pod.
    Consider how Kubernetes syncs ConfigMap data to the volume.
    You got /4 concepts.