Rajvir Jhawar
07/28/2022, 9:22 AMAnna Geller
from prefect.infrastructure import KubernetesJob
k8s_job = KubernetesJob(
command=["echo", "hello"],
namespace="dev",
customizations=[
{
"op": "add",
"path": "/spec/template/spec/containers/0/command/0",
"value": "opentelemetry-instrument",
},
{
"op": "add",
"path": "/spec/template/spec/containers/0/command/1",
"value": "--resource_attributes",
},
{
"op": "add",
"path": "/spec/template/spec/containers/0/command/2",
"value": "service.name=my-cool-job",
},
],
)
k8s_job.save("append-commands")
Out[15]: UUID('5b0504f9-f4bc-4f0c-a814-9dd6a79b04a6')
UI will then display it