How to pass a parameter to docker with kubernetes

10/5/2015

I'm starting a container using kubernetes and I have to send a -v parameter to docker. I'm searching for it about 3 hours and no success. Here you can see my run command:

kubectl run api --image=${API_IMAGE} --port=${PORT_SERVICE} --overrides='{"apiVersion": "v1","spec": {"template": {"spec": {"containers": [{"name": "api","image": "'${API_IMAGE}'","env": [{"name": "listen","value": "0.0.0.0"},{"name": "etcdAddr","value": "'${ETCD_ADDR}'"}]}]}}}}'

-- Poliane Brito
docker
kubernetes

1 Answer

10/5/2015

You want to use the Volumes construct, which is quite well explained in the docs and used in a number of examples.

If you want to use a host directory, use the hostPath volume type. There's an example of using it here.

-- Alex Robinson
Source: StackOverflow