To be used in an initContainer section of a Job to prevent the Job from starting before the 'compute' Pods are all running.
Build with the default Kubernetes version (see Dockerfile):
$ docker build -t jjhursey/k8s-waitfor:ppc64le -f Dockerfile .
Build with a different Kubernetes version (v1.16.0 in this case):
$ docker build -t jjhursey/k8s-waitfor:ppc64le --build-arg _K8S_VERSION=v1.16.0 -f Dockerfile .
$ docker pull jjhursey/k8s-waitfor
Requirements:
apiVersion: batch/v1
kind: Job
...
initContainers:
- name: my-waiter
imagePullPolicy: Always
image: jjhursey/k8s-waitfor:ppc64le
command: ["timeout"]
# Arguments:
# (1) timeout length in seconds before re-cycling the initContainer
# (2) The program to run to wait for the pods
# (3) The number of pods to wait for
# (4) Selector to pass to "kubectl get pods -l" to pick the pods to to track to Running
# (5) Cluster domain defined by the headless service
args: [
"30",
"/opt/mpi/bin/k8s-wait-for-pods.sh",
"2",
"parallelJob.name=my-job",
"my-mpi-service"
]
Content type
Image
Digest
Size
111.2 MB
Last updated
almost 7 years ago
docker pull jjhursey/k8s-waitfor