-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add more secure SecurityContext to injected pod containers #6515
Conversation
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Are we sure we want to add this by default? Triggers tried doing this but we had to make it optional due to it not working on some environments: tektoncd/triggers#1563 For #5896, it seems like we could document not creating taskruns/pipelineruns in the tekton-pipelines namespace? |
This is good to know! WDYT about introducing a new feature flag?
It seems pretty reasonable to not support creating taskruns in tekton-pipelines, but I think we should probably support creating taskruns in other namespaces that might have restricted pod security admission, especially since none of our injected containers need elevated privileges |
Opt-in sounds good to me. |
/hold |
I like the idea of opt-in with possible going "opt-out" in the future (given a timeframe). As long as it is configurable, we can work around it. |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/hold cancel |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Created #6633 to track this flake. |
/assign |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
This commit adds a SecurityContext to containers injected into TaskRun pods to allow them to run in namespaces with "restricted" pod security admission policies. This includes both init containers and the sidecar container which extracts results. See https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted. It assumes that a TaskRun is meant to run on Windows if and only if it has a podTemplate with a nodeSelector containing "kubernetes.io/os: windows". (See https://kubernetes.io/docs/concepts/windows/user-guide/.) This functionality is guarded behind a feature flag that defaults to false, as it may not work on all Kubernetes implementations.
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom, vdemeester 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
This commit adds a SecurityContext to containers injected into TaskRun pods to allow them to run in namespaces with "restricted" pod security admission policies. This includes both init containers and the sidecar container which extracts results. See https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted.
It assumes that a TaskRun is meant to run on Windows if and only if it has a podTemplate with a nodeSelector containing "kubernetes.io/os: windows". (See https://kubernetes.io/docs/concepts/windows/user-guide/.)
This functionality is guarded behind a feature flag that defaults to false, as it may not work on all Kubernetes implementations.
/kind bug
Closes #5896
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes