This section will guide you through the process of submitting jobs in Kubernetes to the EKS Cluster by modifying the workload POD configuration and submitting the job to the Kubernetes cluster.
1. Modifying the Workload Pod YAML File
To ensure that your workload runs on Exostellar nodes with certain attributes, and it is scheduled by the Exostellar Karpenter autoscaler, you need to set affinity settings in your workload YAML file. Below is an example of how to modify your YAML file to include these settings.:
Code Block | ||
---|---|---|
| ||
apiVersion: v1 kind: Pod metadata: name: my-workload-pod spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: karpenter.sh/nodepool operator: In values: - pool-a containers: - name: my-container image: my-image:latest ...... |
2. Adding Node Labels in Exostellar Karpenter
...
NodePool
If your workload requires scheduling on nodes with specific labels, it is required to configure Exostellar Karpenter Node Pool NodePool so nodes are created with needed labels in autoscaling process. To ensure that Exostellar Karpenter provisions nodes with the appropriate labels, you need to update the Karpenter node pool NodePool configuration with the help the following command:
Code Block |
---|
kubectl edit nodepool pool-a |
An example nodepool NodePool configuration shown below creates nodes that has jobtype
of batch and node family of c5:
Code Block | ||
---|---|---|
| ||
apiVersion: karpenter.sh/v1beta1 kind: NodePool metadata: annotations: karpenter.sh/nodepool-hash: "5387397268510218159" creationTimestamp: "2024-05-10T20:06:58Z" generation: 12 name: pool-a resourceVersion: "38017128" uid: e61de5dc-c6ca-4307-b5c6-8d43dd809c35 spec: disruption: consolidationPolicy: WhenUnderutilized expireAfter: Never limits: cpu: "420" template: metadata: labels: jobtype: batch nodeFamily: c5 spec: nodeClassRef: name: pool-a requirements: - key: topology.kubernetes.io/zone operator: In values: - us-east-1a resources: {} status: {} |
3. Submitting the Workload Job
After modifying the workload YAML file, submit the job to Kubernetes cluster EKS Cluster just like you would run a regular pod.:
Code Block |
---|
kubectl apply -f workload-pod.yaml |
...