Skip to content

feat(helm): limit webhooks only to namespaces with kuma.io/sidecar-injection label #13378

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

Merged
merged 7 commits into from
Apr 16, 2025

Conversation

lukidzi
Copy link
Contributor

@lukidzi lukidzi commented Apr 10, 2025

Motivation

Webhooks currently use a very broad namespace selector that only excludes the kube-system namespace. To improve both security and performance, we’ve decided to restrict webhooks to only watch namespaces that have the kuma.io/sidecar-injection label.

Implementation information

  • Update the namespace selector to include only namespaces labeled with kuma.io/sidecar-injection, or kuma-system (for mesh defaulter/owner reference cases).
  • Add an UPGRADE.md section with a Bash script that checks for pods participating in the mesh that are located in namespaces without the kuma.io/sidecar-injection label

Needs: #13377

Supporting documentation

Fix #13372

lukidzi added 5 commits April 10, 2025 15:00
Signed-off-by: Lukasz Dziedziak <[email protected]>
Signed-off-by: Lukasz Dziedziak <[email protected]>
@lukidzi lukidzi marked this pull request as ready for review April 15, 2025 11:21
@lukidzi lukidzi requested a review from a team as a code owner April 15, 2025 11:21
@lukidzi lukidzi requested review from jijiechen and slonka April 15, 2025 11:21
Copy link
Contributor

Reviewer Checklist

🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
If something doesn't apply please check the box and add a justification if the reason is non obvious.

  • Is the PR title satisfactory? Is this part of a larger feature and should be grouped using > Changelog?
  • PR description is clear and complete. It Links to relevant issue as well as docs and UI issues
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as an image registry)
  • IPv6 is taken into account (.e.g: no string concatenation of host port)
  • Tests (Unit test, E2E tests, manual test on universal and k8s)
    • Don't forget ci/ labels to run additional/fewer tests
  • Does this contain a change that needs to be notified to users? In this case, UPGRADE.md should be updated.
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label)

Copy link
Contributor

@slonka slonka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions for upgrade.md and there is definitely something that got merged badly because one point is in the middle of another

lukidzi and others added 2 commits April 16, 2025 05:55
Co-authored-by: Krzysztof Słonka <[email protected]>
Signed-off-by: Lukasz Dziedziak <[email protected]>
Signed-off-by: Lukasz Dziedziak <[email protected]>
@lukidzi lukidzi requested a review from slonka April 16, 2025 10:57
@lukidzi lukidzi merged commit 4b76f92 into kumahq:master Apr 16, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce WebHooks scope
2 participants