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
CodePudding user response:
This is a v1.22 beta feature which currently not available on EKS v1.21.x.
CodePudding user response:
EKS don't support release 1.22, https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html
This feature only available in 1.22 K8s release
You can check issue status at : https://github.com/aws/containers-roadmap/issues/1397
K8s document : https://kubernetes.io/blog/2021/04/19/introducing-indexed-jobs/
If you just want to try it on K8s, i would suggest checking out the GKE.
GKE Rapid channel has both 1.22 & 1.23 release option.
GKE Rapid channel release notes : https://cloud.google.com/kubernetes-engine/docs/release-notes-rapid