Henning Holgersen
02/26/2024, 8:51 AMworkload: etl
and environment variable TEAM="ETL"
?Marvin
02/26/2024, 8:51 AMyaml
apiVersion: batch/v1
kind: Job
metadata:
name: etl-job
labels:
workload: etl
spec:
template:
metadata:
labels:
workload: etl
spec:
containers:
- name: etl-container
image: your-image-name:latest
env:
- name: TEAM
value: "ETL"
restartPolicy: Never
Please replace your-image-name:latest
with the actual name of the Docker image that you want the job to run. This manifest defines a Job
resource named etl-job
that will create a pod with a single container that has the TEAM
environment variable set to "ETL"
. The pod's restart policy is set to Never
, which is the usual policy for batch jobs.Henning Holgersen
02/26/2024, 8:51 AMHenning Holgersen
02/26/2024, 8:52 AMMarvin
02/26/2024, 8:52 AMjson
{
"apiVersion": "batch/v1",
"kind": "Job",
"metadata": {
"name": "etl-job",
"labels": {
"workload": "etl"
}
},
"spec": {
"template": {
"metadata": {
"labels": {
"workload": "etl"
}
},
"spec": {
"containers": [
{
"name": "etl-container",
"image": "your-image-name:latest",
"env": [
{
"name": "TEAM",
"value": "ETL"
}
]
}
],
"restartPolicy": "Never"
}
}
}
}
Remember to replace your-image-name:latest
with the actual name and tag of your Docker image. This JSON defines the same resources as before, just in JSON notation.