Kubernetes - Override Volume

4/27/2018

I am currently trying to use the "--overrides" option in k8s to mount a local directory that a docker container can access and then run a command against that container utilizing that directory.

kubectl run -i --tty cic-v1 --image=image1 --restart=Never --overrides={"spec":{"volumeMounts":[{"name":"input","mountPath":"/usr/src/data/input"},{"name":"output","mountPath":"/usr/src/data/output"}],"volumes":[{"name":"input","hostPath":{"path":"/input/"}},{"name":"output","hostPath":{"path":"/output/"}}]}}

Ideally this is done inline without the use of a .yaml file. All attempts result in... error: Invalid JSON Patch ...and I am having difficulty debugging this. Has anyone accomplished anything similar?

-- phnx0023
docker
kubernetes

1 Answer

8/20/2018

Answer found here.

https://stackoverflow.com/a/37621761/6309

I was incorrectly specifying the 'overrides' option in k8s.

-- phnx0023
Source: StackOverflow