ameya agashe:
There is no /test-mnt mount point on host, still pod is running fine and even reports the percentage of disk used. I am confused!!
Can someone please help me understand ?
[root@master1 ~]$ cat nginx-hostpath.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-hostpath
spec:
containers:
- name: nginx-container
image: nginx
volumeMounts:
- mountPath: /test-mnt
name: test-vol
volumes:
- name: test-vol
hostPath:
path: /test-vol
[root@master1 ~]$ ls -larth /test-mnt
ls: cannot access '/test-mnt': No such file or directory
[root@master1 ~]$ df -Ph |grep test
[root@master1 ~]$ k get po
NAME READY STATUS RESTARTS AGE
nginx-hostpath 1/1 Running 0 5m12s
test-deploy-7955784f5c-9bkg6 1/1 Running 1 (9m8s ago) 18h
test-deploy-7955784f5c-rgkq8 1/1 Running 1 (9m9s ago) 18h
[root@master1 ~]$ kubectl exec nginx-hostpath -- df /test-mnt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 9983232 5227388 4739460 53% /test-mnt