-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Chart: Tighten securityContext
s and Pod Security Policies.
#10491
Conversation
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @Gacko. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
2f8c6da
to
65f555c
Compare
6b156b0
to
f9e9710
Compare
Extracts the default backend `securityContext` into a template, as for the controller.
…troller.sysctls`.
…etry`. - Add `controller.extraModules.distroless` & `controller.extraModules.resources`. - Add `controller.opentelemetry.name` & `controller.opentelemetry.distroless`. - Align `extraModules` inclusion for `controller.extraModules` & `controller.opentelemetry`. - Remove redundant whitespaces.
…patch.securityContext`.
Due to recent changes, the controller image can be run without privilege escalation: - kubernetes#8499 - kubernetes#7449
Moves the pod `securityContext` to the containers to not interfere with injected containers.
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Gacko, rikatz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-1.9 |
@strongjz: #10491 failed to apply on top of branch "release-1.9":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does / why we need it:
This PR tightens the security context settings of all the containers involved in the chart. The single commits contain detailed information about what has been changed and why.
I first of all fixed some minor issues in the
values.yaml
, improved the documentation and aligned & improved both the helpers and the templating itself, before I actually applied more restrictive default values in thevalues.yaml
and the Pod Security Policies. This brings the chart a big step forward to being compliant with the Pod Security Standards profileRestricted
.I'm aware of Pod Security Policies being deprecated since Kubernetes v1.21.0 and removed in v1.25.0. But since there probably are several users out there still running on Kubernetes v1.24.0 or below, it could make sense to provide a chart compatible and well prepared for moving to Pod Security Standards in Kubernetes v1.25.0 and above.
This is why I also put some effort into the still existing Pod Security Policies. I did not add any new resources related to them, only refactored the templating and tightened their default values, and so they still can easily be removed once support for v1.24.0 and below gets dropped.
Types of changes
Which issue/s this PR fixes
How Has This Been Tested?
I spun up a Kubernetes cluster and tested the changes made in each commit separately and manually, including different values for also testing edge cases and special conditions.
Checklist: