I am running minikube/Kubernetes and am having difficulty accessing a volume from a volumeMount in a deployment.
I can confirm that when the microservice starts up, it is not able to access the /config directory (ie. the "mountPath" in the "volumeMounts"). I have verified that the hostPath/path is valid.
I have experimented with a number of techniques and have also validated that the deployment files is correct. I have also tried using quotes/double-quotes/no-quotes around the path specifications, but this does not address the issue.
Note that I am using a "hostPath" for simple testing purposes, however, this is the scenario that I nevertheless need to address.
My minikube configuration is illustrated below:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"2017-01-12T07:30:54Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"linux/amd64"}
I am running minikube on MacOS/Sierra version 10.12.3 (16D32).
My deployment file (deployment.yaml):
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: atmp1000-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: atmp1000
spec:
containers:
- name: atmp1000
image: atmp1000
ports:
- containerPort: 7010
volumeMounts:
- name: atmp1000-volume
mountPath: '/config'
volumes:
- name: atmp1000-volume
hostPath:
path: '/Users/<username>/<some-path>/config'
Any help is appreciated.