Henning Holgersen
02/20/2024, 11:53 AMMarvin
02/20/2024, 11:53 AMyaml
apiVersion: batch/v1
kind: Job
metadata:
name: example-job
labels:
azure.workload.identity/use: "true"
spec:
template:
metadata:
labels:
azure.workload.identity/use: "true"
spec:
containers:
- name: example-container
image: your-image:latest
env:
- name: MID
value: "123"
restartPolicy: Never
Replace your-image:latest
with the Docker image you wish to run in the job. Adjust the restartPolicy
and other configuration details to match the specific requirements of your job.
Remember, you may need additional configuration for using Azure Workload Identity with your Kubernetes cluster, such as annotation on service accounts and proper IAM configuration. Ensure you have all necessary prerequisites configured before applying this job to your cluster.Henning Holgersen
02/20/2024, 11:56 AMMarvin
02/20/2024, 11:56 AMjson
{
"apiVersion": "batch/v1",
"kind": "Job",
"metadata": {
"name": "example-job",
"labels": {
"azure.workload.identity/use": "true"
}
},
"spec": {
"template": {
"metadata": {
"labels": {
"azure.workload.identity/use": "true"
}
},
"spec": {
"containers": [
{
"name": "example-container",
"image": "your-image:latest",
"env": [
{
"name": "MID",
"value": "123"
}
]
}
],
"restartPolicy": "Never"
}
}
}
}
Again, replace "your-image:latest"
with the actual image you want to use. Make sure to validate and adjust this JSON to fit your exact situation and configurations required by your Kubernetes environment and Azure identity setup.