Hello Prefect Community! I have a question about t...
# prefect-community
h
Hello Prefect Community! I have a question about the KubernetesJobEnvironment. Is there a way to see what job environment has been stored/is being used? I would be fine with either something through the interactive API or getting into the docker image
đź‘€ 1
l
I think you’re talking about the environment as set in your job_spec.yaml you passed to the KubernetesJobEnvironment, maybe even just the name of the yaml file itself. Unfortunately poking around a bit I don’t think the job_spec file, or any of its contents, is serialized to Cloud/Server so it wouldn’t be accessible from the interactive API, so if you are using many different job specs it might be hard to track down. As a random tip you can see (at least in GCP) the yaml file used by a job itself from the google cloud console console, or use its equivalent from the CLI (which I think should be
kubectl get job my-job --output=yaml
). If you really wanted to inspect it at runtime I think you can get into the pod of the job for as long as it lives with
kubectl exec
but I think you should be able to piece it together between any environment baked into the image you picked, what you wrote in your custom job spec, and what gets added for you by Prefect (I can’t jump link directly but its at the bottom of this section: https://docs.prefect.io/orchestration/execution/k8s_job_environment.html#job-spec-configuration)
h
thank you! I am trying to figure out why my secret environment variables are not working and was hoping to see if i could poke around. I think i have found another solution though