Hi @Mumshad Mannambeth @Tej_Singh_Rana Posting it again for the confirmation &am . . .

Rahul:
Hi @Mumshad Mannambeth @Tej_Singh_Rana Posting it again for the confirmation & what exam expects for below question -

• Create a ConfigMap named first-config containing the key/value pair: key1/value1
• start a pod named nginx-config containing a single container using the nginx image, and mount the key you just created into the pod under directory /var/a/path

For this question , what would be the correct answer ?
Provide items seperately to get the value of key1 & how do we make mountPath. Is below correct ?

volumeMounts:
        - name: config-vol
          mountPath: /var/a
  volumes:
    - name: config-vol
      configMap:
        name: first-config
        items:
          - key: key1
            path: path

OR

No need to provide items seperately.

volumeMounts:
        - name: config-vol
          mountPath: /var/a/path
  volumes:
    - name: config-vol
      configMap:
        name: first-config

Fernando Jimenez:
Hello @Rahul
The variation between selecting a specific key/path and not selecting any is a choice for the same thing. When you select a key/path as items you are saying: “create a file with this data and mount it in the pod”. When you do not declare it, it will create a file for every key and it will mount it in the pod. If you have multiple keys, the difference is that you might end up with more files (no harm), if you only have one key, there is no difference.