I am new to Kubernetes and AWS and I have a problem. I am trying to run parallel Kubernetes jobs on an EKS cluster. How can I get the environment variable JOB_COMPLETION_INDEX? I have tested my Java code before with Minikube "locally", there everything works fine. But when I switch to the EKS cluster, System.getenv("JOB_COMPLETION_INDEX") = null. What am I missing? What am I doing wrong?
I used EKS version 1.21.2.
apiVersion: batch/v1
kind: Job
metadata:
name: calculator
labels:
jobgroup: calculator
spec:
parallelism: 2
completions: 4
completionMode: Indexed
template:
metadata:
name: calculator
spec:
containers:
- name: calculater
image: fbaensch/calculator_test:latest
imagePullPolicy: Always
restartPolicy: Never