Gaurav Kumar
08/03/2023, 7:30 AMprivileged: true
for securityContext in Container. I have added the PodTemplate in the task as below which includes the image name as well. However, I’m seeing that after executing the workflow, Pod seems to be carrying privileged: True
for container but the image is set to default image for flyte. What changes do I need to make for this to get my image ?
Code for task definition
@task(pod_template=PodTemplate(
primary_container_name="primary",
pod_spec=client.V1PodSpec(
containers=[
client.V1Container(
name="primary",
image="my-custom-image",
security_context=client.V1SecurityContext(
privileged=True
)
)
],
)
))
After executing the workflow, this is what I found podSpec to be
.............
image: <http://cr.flyte.org/flyteorg/flytekit:py3.8-1.8.0|cr.flyte.org/flyteorg/flytekit:py3.8-1.8.0> <<<<<<<<< uses default image
imagePullPolicy: IfNotPresent
name: primary
resources:
limits:
cpu: "2"
memory: 200Mi
requests:
cpu: "2"
memory: 200Mi
securityContext:
privileged: true <<<<<<< Set to True as expected
..........
container_image=
in the task. But, I want to know why specifying the image in PodTemplate in not getting picked up.Yee
container_image="my-image"
to the task decorator? outside of the podtemplateGaurav Kumar
08/03/2023, 4:17 PMI see that my image is getting used if I specifyYes, that’s working for me.in the task. But, I want to know why specifying the image in PodTemplate in not getting picked up.container_image=