Created
December 14, 2021 11:28
-
-
Save hideojoho/d2d992e1723e68cc1135185fdaa344eb to your computer and use it in GitHub Desktop.
How to pass JOB_COMPLETION_INDEX to a pod as an environment variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: indexed-job | |
spec: | |
completions: 5 | |
parallelism: 3 | |
completionMode: Indexed | |
template: | |
spec: | |
restartPolicy: Never | |
containers: | |
- name: worker | |
image: foo/bar | |
env: | |
- name: INDEX-VAL | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.annotations['batch.kubernetes.io/job-completion-index'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment