strong-carpet-69168
08/02/2023, 2:38 PMimagePullPolicy=Always
for task pods?
I have a question regarding task pods. We recently encountered the problem that a certain package was not installed in our custom task image, however we could clearly see that the package has been installed. We did a little research and recognized that the task pod has imagePullPolicy: IfNotPresent
. So our Kubernetes cluster took the image from the internal cache and thus took the "old" one. We need to overcome this problem.
We installed flyte via helm
with a custom values.yaml
.
Can we set the task imagePullPolicy somewhere to Always? Is there any other way to enforce a fresh image pull each time?freezing-airport-6809
freezing-airport-6809
strong-carpet-69168
08/03/2023, 2:08 PMfreezing-airport-6809
average-finland-92144
08/04/2023, 12:34 PMImagePullPolicy
is not configurable from the Helm chart.
Nevertheless, Flyte provides a native mechanism to modify this type of Pod-level parameters: PodTemplate
You can either define a global PodTemplate or even declare one inline per-task:
https://docs.flyte.org/en/latest/deployment/configuration/general.html#using-k8s-podtemplates
Please let us know if it answers your questionloud-belgium-4006
08/14/2023, 4:54 PMfrom flytekit.core.pod_template import PodTemplate
from kubernetes.client.models import V1PodSpec, V1Volume, V1Container, V1VolumeMount, V1EnvVar, V1PersistentVolumeClaimVolumeSource
ps = V1PodSpec(
containers=[
V1Container(
name='primary',
image='<http://docker.io/rwgrim/docker-noop|docker.io/rwgrim/docker-noop>',
image_pull_policy='Always',
)
]
)
]
)
@task(task_config=Pod(pod_spec=ps))
def always_pull_task():
...