Hey team! Hope you’re doing okay :slightly_smiling...
# ask-the-community
f
Hey team! Hope you’re doing okay 🙂 . I’ve got one question related to PodTemplate vs the config through the Plugin. I’m using the plugin config, and also the PodTemplate. Both are working as expected, so for example, if I set some labels in the plugin, and some labels in the PodTemplate, Tasks have the expected labels 👍 . However, when I define envs in the PodTemplate, they are not being reflected at all in the Flyte Task. If I define the default envs in the plugin config, they show up in the Task. Something I could be missing here?
f
I think the env from the pod plugin will overwrite the env in the PodTemplate. Do you have an env specified in the pod_spec?
f
I removed it as well and nothing 😕 . Tried removing the entry from the plugin, or setting it to null and {}
f
is it a normal python decorated task?
f
Yes
f
hm... seems like they are not merged in the backend. I vaguely remember discussing a similar case with @Dan Rammer (hamersaw) or @Eduardo Apolinario (eapolinario)
d
@Franco Bocci this may be a bug. Can you provide an example of the PodTemplate definition in the plugin and also the task definition. I would be happy to debug this!
f
Plugin:
Copy code
plugins:
  k8s:
    default-cpus: 100m
    default-memory: 100Mi
    default-pod-template-name: flyte-pod-template
    default-annotations:
      - <http://iam.amazonaws.com/role|iam.amazonaws.com/role>: some-aws-role
    default-env-vars:
      - LOG: "debug"
    default-labels:
      - an-index: "some-flyte-index"
    resource-tolerations:
      <http://nvidia.com/gpu|nvidia.com/gpu>:
        key: flyte/gpu
        value: dedicated
        operator: Equal
--- Pod Template:
Copy code
apiVersion: v1
kind: PodTemplate
metadata:
  name: flyte-pod-template
  namespace: flyte-namespace-of-my-project-development
template:
  metadata:
    labels:
      - foo
    annotations:
      - foo: initial-value
  spec:
    containers:
      - name: default
        image: <http://docker.io/rwgrim/docker-noop|docker.io/rwgrim/docker-noop>
        env:
          - name: SOME
            value: variable
          - name: ANOTHER
            value: variable
I tried other things like: • not defining env variables in the plugin • using container name “primary” and “default” • setting the pod template for the “flyte” namespace
d
Oh interesting, so you're saying the env var
LOG: "debug"
from the plugin is reflected in the
Pod
. However, the
ANOTHER: variable
and
SOME: variable
are not? The labels and annotations from the
PodTemplate
are coming through though right?
First, what version of flytepropeller are you running? I know we added support for container-level configuration after the initial PodTemplate work.
f
100% correct. • Labels and Annotations from the PodTemplate integrate correctly with the plugin • Envs do not get passed at all
d
re ^ this support should be in propeller 1.1.38
I tested this locally with the latest propeller and the
PodTemplate
env vars are coming through. I'm guessing this is a propeller version issue.
f
Ours is v1.1.0 . It’s that then
155 Views