How to make sure two pods are on the same node?

7/12/2016

So I want to share a file between 2 pods, problem is they can get separated on different nodes so mounting a volume wont do it.

Is it possible to force pods to deploy always on the same node?

Are they any solutions other then using google storage?

(Its a big file and I want to avoid sending it back and forth thru google storage API).

Thanks

-- Blue Bot
google-cloud-platform
google-kubernetes-engine

1 Answer

7/12/2016

If you want to be certain that two containers will be on the same node so that they can share local storage, you should put them into the same pod. Pods are the unit of scheduling, so a pod (with N containers in it) will always cause the N containers to run on the same node.

-- Robert Bailey
Source: StackOverflow