Kubernetes - level3 -- Kubernetes LEMP Setup

Hi Team, I am getting below error while doing everything correctly.

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/058f3b39-c968-420d-bcd0-17b8279d738f/volumes/kubernetes.io~configmap/php-ini” to rootfs at “/opt/docker/etc/php/php.ini”: mount /var/lib/kubelet/pods/058f3b39-c968-420d-bcd0-17b8279d738f/volumes/kubernetes.io~configmap/php-ini:/opt/docker/etc/php/php.ini (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown
Warning BackOff 22s (x7 over 109s) kubelet Back-off restarting failed container nginx-php-container in pod lemp-wp-7c758b5487-qtrrd_default(058f3b39-c968-420d-bcd0-17b8279d738f)

Solved I was missing subPath

volumeMounts:
- name: config-vol
mountPath: /opt/docker/etc/php/php.ini
subPath: php.ini

1 Like