Skip to content

PodPreset needs to be in the same name space as the pod? #13

@jmozd

Description

@jmozd

While debugging a fresh podpreset-webhook setup, I noticed that the name space of the PodPreset object seems relevant when deciding to which pods it is applicable.

I created a PodPreset with no "namespace" setting:

apiVersion: redhatcop.redhat.io/v1alpha1
kind: PodPreset
metadata:
  name: presettest
spec:
  env:
  - name: SOMEVAR
    value: "somevalue"
  selector:

and verified the variable got applied to a test pod I created (the pod ended up in the "default" name space). Newly created pods in the "kube-system" name space did not have SOMEVAR injected and I traced that down to filterPodPresets() returning an empty list.

Once I created another instance of PodPreset, in the "kube-system" name space, the injection also worked for newly created pods in the "kube-system" name space.

  1. do I see this correctly, or did I simply mess up my config?
  2. if that's how it works, I'd love to see it mentioned in README.md
  3. is there a way to actually configure a PodPreset to apply to every name space?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions