Hi, I've been reading these docs on using Kubernet...
# ask-community
a
Hi, I've been reading these docs on using Kubernetes for executing flows, however I can't seem to figure out how to specify that an environment variable should be filled in from a kubernetes secret in the prefect deployment yaml file. Any guidance here would be appreciated. https://docs.prefect.io/latest/guides/deployment/kubernetes/
1
I thought it might be in the under
Copy code
job_variables:
  env:
    ...
but it seems Prefect expects the value of
env
to be an object, whereas when you're defining a kubernetes deployment yaml file,
env
is a list of environment variables, i.e.
Copy code
env:
- name: POSTGRES_PASSWORD
  valueFrom:
    secretKeyRef:
      name: db-password
      key: db-password
so not exactly sure how define this in the prefect deployment yaml file.
k
you can edit the expected type for
env
in your work pool config's advanced tab
let me grab you an example
🙌 1
can you try this? under
variables
->
properties
Copy code
"env": {
        "title": "Environment Variables",
        "anyOf": [
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ],
        "description": "Environment variables to set when starting a flow run.",
        "additionalProperties": {
          "type": "string"
        }
      }
🙌 1
just edited a slight correction in case you already copied it
👍 1
you should even see a type picker in the UI once you save it
a
Thank you so much, will give this a try!
@Kevin Grismore That worked great! Thanks again 🙂
🙌 2