Hello, I’m trying out flyte in a sandbox deploymen...
# ask-the-community
g
Hello, I’m trying out flyte in a sandbox deployment for experimentation. For a particular task, I need to include
privileged: 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
Copy code
@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
Copy code
.............
    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
   ..........
I see that my image is getting used if I specify
container_image=
in the task. But, I want to know why specifying the image in PodTemplate in not getting picked up.
I found this bug https://github.com/flyteorg/flyte/issues/3624 similar to this. Is this a known issue ?
y
perhaps it’s not getting respected… could you try something else for me?
can you try adding
container_image="my-image"
to the task decorator? outside of the podtemplate
g
I see that my image is getting used if I specify
container_image=
in the task. But, I want to know why specifying the image in PodTemplate in not getting picked up.
Yes, that’s working for me.