Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot add label to nodes #2397

Closed
mthoretton opened this issue Sep 15, 2021 · 2 comments
Closed

[BUG] Cannot add label to nodes #2397

mthoretton opened this issue Sep 15, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mthoretton
Copy link

mthoretton commented Sep 15, 2021

Software version numbers

  • Kubernetes version: 1.21
  • Kubernetes platform: EKS
  • Kyverno version: v1.4.3-rc2 deployed via helm chart

Describe the bug
I want to add labels on new nodes. The following policy does not work (the exact same work if I simply replace, in the resources kind, Node by Namespace for instance).

kubectl describe cpol -n kyverno add-labels I see nothing in the events section. I also see nothin in the kyverno logs.

Maybe important: new nodes are created by the autoscaler group.

To Reproduce

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: add-labels
spec:
  background: false
  rules:
  - name: add-ns-label
    match:
      resources:
        kinds:
        - Node
    mutate:
      patchStrategicMerge:
        metadata:
          labels:
            foo: bar

Additional context
It's the first time I use kyverno so maybe I misunderstood something or miss some relevant parts of the doc. It seems to be a bug to me, but maybe the Node resources behave differently than others ? 🤔

Thanks!

@mthoretton mthoretton added the bug Something isn't working label Sep 15, 2021
@realshuting
Copy link
Member

Hi @mthoretton - have you configured the default resourceFilters? The Node is excluded by default.

@mthoretton
Copy link
Author

@realshuting Thanks for your quick answer. Yes I think that was it indeed ... 🙈 Sorry for the noise, I am not sure what I did wrong. I started again with a fresh and clean setup and now it's working perfectly...

Thanks and sorry again!

@realshuting realshuting self-assigned this Sep 16, 2021
@realshuting realshuting added this to the Kyverno Release 1.5.0 milestone Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants