Kubernetes volume hostPath

I want to use kubernetes as my default development environment since I installed the cluster locally with docker as described in the white paper . I click my example on the github repository

My settings after starting the kubernetes cluster:

* 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 

My problems arise because I want to map the local directory as a volume inside my application, so I can dynamically share files between my local host and module, so I can design, modify files; and dynamic service updates.

I am using a host volume. The package, the replication controller, and the service are created successfully, but the module does not have shared access to the directory, it does not even have a file on the mountPath.

What am I doing wrong?

thanks

+6
source share
1 answer

The problem was with the volume definition, the hostPath.path property must contain the absolute address of the directory to mount.

Example:

 hostPath: path: /home/bitgandtter/Documents/development/php/k8s_devel_env 
+15
source

All Articles