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
153 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 35,720 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
• 35,720 points
43 views
0 votes
1 answer
0 votes
1 answer

Kubernetes error syncing pod

The issue caused by the docker container ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 35,720 points
443 views
0 votes
1 answer

Define pod yaml dynamically-jenkins pipeline Kubernetes

Try using jinja template engine and python ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 35,720 points
101 views
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
631 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
• 35,720 points
30 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
• 35,720 points
215 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.