Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README.md
indexedjob-controller.yaml
my-indexedjob.yaml
sync.py
test.sh

README.md

IndexedJob

This is an example CompositeController that's similar to Job, except that each Pod gets assigned a unique index, similar to StatefulSet.

Prerequisites

Deploy the controller

kubectl create configmap indexedjob-controller -n metacontroller --from-file=sync.py
kubectl apply -f indexedjob-controller.yaml

Create an IndexedJob

kubectl apply -f my-indexedjob.yaml

Each Pod created should print its index:

$ kubectl logs print-index-2
2

Failure Policy

Implementing activeDeadlineSeconds and backoffLimit is left as an exercise for the reader.