Not able to mount local directory in Pod

4/19/2020
apiVersion: apps/v1
kind: Deployment
metadata:
     name: my-deploymenta
     namespace: nginx-ingress
     labels:
         app: myapp
spec:
     replicas: 1
     selector:
          matchLabels:
               app: myapp
     template:
           metadata:
                name: myapp
                labels:
                   app: myapp
           spec:
              containers:
                  - name: nginx
                    image: nginx
                    volumeMounts:
                      - name: config-volume
                        mountPath: /usr/share/nginx/html
              volumes:
                 - name: config-volume
                   hostPath:
                        path: /home/pjangra/abc

"/home/pjangra/abc has different index.html file. Actually i want to mount everything underneath /home/pjangra/" (edited) 07:57 i am able to achieve same via configMap but i dont wanna that.

-- Pravesh Jangra
kubernetes
kubernetes-pod

1 Answer

4/19/2020

You are trying to mount the home directory of user "pjangra". This directory will only give read and write permissions to user pjangra. Either update the permissions of the directory on the Kubernetes node or use some other directory.

-- RAMNEEK GUPTA
Source: StackOverflow