CKA Mock exam 1 question

Question:For this question, please set the context to cluster1 by running:
kubectl config use-context cluster1

The blue-dp-cka09-trb deployment is having 0 out of 1 pods running. Fix the issue to make sure that pod is up and running.

Troubleshooting: There was some problem in init container that i fixed. After that it was showing below error in pod
Warning Failed pod/blue-dp-cka09-trb-69dd844f76-rv9z8 Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/lib/kubelet/pods/98182a41-6d6d-406a-a3e2-37c33036acac/volumes/kubernetes.io~configmap/nginx-config"to rootfs at “/etc/nginx/nginx.conf”: mount /var/lib/kubelet/pods/98182a41-6d6d-406a-a3e2-37c33036acac/volumes/kubernetes.io~configmap/nginx-config:/etc/nginx/nginx.conf (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown

What does this error implies?

Hi @uzmashafi061,

You need to add subPath on volume Mounts check this documentation :

   - mountPath: /etc/nginx/nginx.conf
      name: nginx-config
      subPath: nginx.conf

But how to know if i need to add subPath or not?

I don’t understand the use of this subpath and how it works with the configmap.