https://prefect.io logo
#prefect-community
Title
# prefect-community
a

Adam

07/30/2020, 1:25 PM
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

Dylan

07/30/2020, 1:35 PM
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

Adam

07/30/2020, 1:42 PM
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

Dylan

07/30/2020, 1:44 PM
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

Adam

07/30/2020, 3:12 PM
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

Dylan

07/30/2020, 3:16 PM
๐Ÿ‘€
@Adam yup! Thatโ€™s perfect ๐Ÿ‘Œ