Specify the order Dockers run on Kubernetes pod

12/30/2014

I am trying to run two Dockers on the same Kubernetes pod and I want one of the Docker container always to run before the other. I remember learning about specifying such dependency on the pod configuration file, but can not find that now. Kubernetes documentation does not explain it either.

Here is the example pod configuration with two containers I adopted from another Stackoverflow question. How should I change this pod configuration to run container type1 before type2?

{
  "id": "podId",
  "desiredState": {
    "manifest": {
      "version": "v1beta1",
      "id": "podId",
      "containers": [{
        "name": "type1",
        "image": "local/image"
        },
        {
        "name": "type2",
        "image": "local/secondary"
        }]
    }
  },
  "labels": {
    "name": "imageTest"
  }
}

Thanks in advance, Nodir.

-- Nodir Kodirov
docker
google-kubernetes-engine
kubernetes

1 Answer

12/30/2014

Kubernetes currently does not allow specification of container startup dependencies.

There has been some discussion in GitHub issues 1996 and 1589 that might help you out.

-- CJ Cullen
Source: StackOverflow