Jason Prado
09/17/2021, 6:32 PMKubernetesAgent
(code here) uses the environment variables used in the k8s deployment, particularly IMAGE_PULL_POLICY
, to build the podspec for a flow run. It looks like if a flow specifies run_config=KubernetesRun(…)
at all, then IMAGE_PULL_POLICY
from the deployment env is ignored? Is that right?Kevin Kho
Jason Prado
09/17/2021, 6:44 PMIMAGE_PULL_POLICY
is specified in the k8s deployment and the KubernetesRun()
object doesn’t specify image_pull_policy
, then it should fall back on the deployment env. But that’s not the case I think, right?Jason Prado
09/17/2021, 6:45 PMKevin Kho
Kevin Kho
Kevin Kho
Kevin Kho
IMAGE_PULL_POLICY
is specifically overriden here if supplied through the RunConfig without touching other fieldsJason Prado
09/17/2021, 7:06 PMcontainer["env"] = container_env
doesn’t matter for creating the podspec, as those are environment variables and imagePullPolicy
is under containers:
in the podspec. But it is actually working like I wanted it to.
my flow passes:
run_config=KubernetesRun(
image="<http://registry.digitalocean.com/tdc-container-registry/prefect-flow|registry.digitalocean.com/tdc-container-registry/prefect-flow>",
labels=["any"],
),
and my prefect-agent deployment is configured:
- name: IMAGE_PULL_POLICY
value: 'Always'
and I see on a running job:
imagePullPolicy: Always
so, I guess it is actually working as intended. I don’t totally see how from reading the code 😅