Kubernetes ConfigMaps and Secrets Management Quiz Quiz

  1. Purpose of ConfigMaps

    What is the main purpose of a ConfigMap in Kubernetes?

    1. To store non-confidential configuration data as key-value pairs
    2. To scale deployments automatically based on load
    3. To manage container images in a registry
    4. To encrypt secret data in transit
    5. To provide persistent storage for Pods
  2. Mounting ConfigMap as a Volume

    Which field in a PodSpec is used to mount a ConfigMap as a volume inside a container?

    1. volumes
    2. envVars
    3. containersConfig
    4. volumeMounts
    5. mountVolumes
  3. Secrets Storage

    Where are Kubernetes Secrets stored by default?

    1. Etcd database
    2. Docker registry
    3. Pod annotations
    4. Kubelet logs
    5. ConfigMap
  4. Correct way to create a ConfigMap

    Which command correctly creates a ConfigMap named 'app-config' from a file named config.properties?

    1. kubectl create configmap app-config --from-file=config.properties
    2. kubectl add configmap app-config config.properties
    3. kubectl configmap create app-config config.properties
    4. kubectl set configmap app-config --file=config.properties
    5. kubectl config add app-config -f config.properties
  5. Using Secrets as Env Vars

    How can you inject a value from a Secret as an environment variable in a Kubernetes Pod?

    1. Using the envFrom field in the Pod spec
    2. By mounting the secret as a command line arg
    3. By specifying it in the volumes field
    4. By referencing it in the labels section
    5. By setting it in the readinessProbe
  6. Data Decoding for Secrets

    What encoding must values use in a Kubernetes Secret manifest YAML?

    1. Base64
    2. Hexadecimal
    3. UTF-16
    4. Plain text
    5. ROT13
  7. ConfigMap vs Secret

    Which resource should you choose in Kubernetes for storing sensitive database passwords?

    1. Secret
    2. ConfigMap
    3. PersistentVolumeClaim
    4. Deployment
    5. ServiceAccount
  8. Updating ConfigMap Data

    If you update the data in a ConfigMap, how do existing Pods using it usually receive the updated data?

    1. They need to be restarted to pick up changes
    2. ConfigMap changes are pushed instantly to running Pods
    3. ConfigMap data is cached and never updates
    4. The API server automatically rewrites the Pod
    5. kubectl apply forces a live update to all pods
  9. Accessing Secret in Pod as File

    If you want a Pod to read credentials from a file, which method should you use?

    1. Mount the Secret as a volume
    2. Add the Secret to container’s command args
    3. Set Secret as environment variables
    4. Reference Secret in Service spec
    5. Include Secret in the readinessProbe
  10. Referencing a ConfigMap Key

    Given this YAML, how do you reference the key 'USERNAME' from ConfigMap 'user-conf' in a Pod's container env? nn env:n - name: APP_USERn valueFrom:n configMapKeyRef:n __________:n name: user-confn key: USERNAME

    1. configMapKeyRef
    2. valueFrom
    3. reference
    4. configValue
    5. mapKey