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/a690b623-fdde-4a14-849f-6b24e73ea1c2/volume-subpaths/nginx-config-volume/nginx-container/0” to rootfs at “/etc/nginx/nginx.conf”: mount /var/lib/kubelet/pods/a690b623-fdde-4a14-849f-6b24e73ea1c2/volume-subpaths/nginx-config-volume/nginx-container/0:/etc/nginx/nginx.conf (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown

My code:-

apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
nginx.config: |
events {}
http {
server {
listen 8094;
index index.html index.htm index.php;
root /var/www/html;
location ~ .php$ {
include fastcgi_params;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param SCRIPT_FILRNAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
}

apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: NodePort
selector:
app: nginx
ports:

  • port: 8094
    targetPort: 8094
    nodePort: 30012

apiVersion: v1
kind: Pod
metadata:
name: nginx-phpfpm
labels:
app: nginx
spec:
volumes:

  • name: shared-files
    emptyDir: {}
  • name: nginx-config-volume
    configMap:
    name: nginx-config
    containers:
  • name: nginx-container
    image: nginx:latest
    volumeMounts:
    • name: nginx-config-volume
      mountPath: /etc/nginx/nginx.conf
      subPath: nginx.conf
    • name: shared-files
      mountPath: /var/www/html
  • name: php-fpm-container
    image: php:8.2-fpm-alpine
    volumeMounts:
    • name: shared-files
      mountPath: /var/www/html