Pod not sharing directory - Kubernetes volume Hostpath

0 votes

I am trying to use kubernetes as my default development environment. I've set up the cluster locally with docker.

My set up steps after having a kubernetes cluster running were:

cd cluster_config/app && docker build --tag=k8s_php_dev . && cd ../..
kubectl -s http://127.0.0.1:8080 create -f cluster_config/app/app.rc.yml
kubectl -s http://127.0.0.1:8080 create -f cluster_config/app/app.services.yml

I am trying to map a local directory as a volume inside my app pod so I can share dynamically the files in there between my local host and the pod, so i can develop, change the files; and dynamically update on the service.

I use a a volume with a hostPath. The pod, replication controller and service are created successfully but the pod do not share the directory not even have the file on the supposed on the mountPath.

What I'm doing wrong?

Aug 28, 2018 in Kubernetes by lina
• 8,100 points
221 views

1 answer to this question.

0 votes

he issue was on the volume definition, the hostPath.path property should hold the absolute address of the directory to mount.

Example:

hostPath:
  path: /home/bitgandtter/Documents/development/php/k8s_devel_env
answered Aug 28, 2018 by Kalgi
• 39,390 points

Related Questions In Kubernetes

0 votes
1 answer

Pod not running as expected in kubernetes

Heyy @Hannah, It may be that there ...READ MORE

answered Oct 26, 2018 in Kubernetes by Kalgi
• 39,390 points
58 views
0 votes
1 answer

Configure a Kubernetes-pod to use persistent volume for storage.

The output shows that the PersistentVolume has ...READ MORE

answered Jul 23 in Kubernetes by Sirajul
• 20,040 points
278 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
982 views
0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 39,390 points
50 views
0 votes
1 answer

Pod status not ready always - kubernetes

I was having the same issue. In the ...READ MORE

answered Sep 6, 2018 in Kubernetes by Kalgi
• 39,390 points
474 views