Friends, another question from me. We're running P...
# prefect-community
a
Friends, another question from me. We're running Prefect Cloud + KubernetesAgent + DaskKubernetesEnvironment. How should we go about accessing existing Kubernetes Secrets and ConfigMaps from within the tasks? I'm not clear on how to make those available to the Dask Jobs as env vars? Would I have to supply a custom
worker_spec_file
that includes env vars with
configMapKeyRef
?
๐Ÿ‘€ 1
d
Hey @Adam! Looking at https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets I believe you are correct ๐Ÿ‘
Let us know if you run into any roadblocks
a
Thanks, let me try create that custom
worker_spec_file
. The only issue I see potentially is specifying the image name and tag that was generated when calling
Docker()
as it seems to be auto generating the tag as I don't specify it. Any way to retrieve the tag once the image is built?
d
You can specify the image name and tag with Docker storage! Take a look here: https://docs.prefect.io/api/latest/environments/storage.html#docker
a
Thanks @Dylan. My plan is to use this yml as my worker_spec_file, and insert my image here and then include my env vars from configmaps: https://github.com/PrefectHQ/prefect/blob/master/src/prefect/environments/execution/dask/worker_pod.yaml Is that the right approach?
d
๐Ÿ‘€
@Adam yup! Thatโ€™s perfect ๐Ÿ‘Œ