-
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 SecurityContext to TaskSpec #714
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dicarlo2 If they are not already assigned, you can assign the PR to them by writing 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 |
If security context is added at Task level then all users of Task are expected to run this with context. Is this run time configuration for TaskRun instead of Task? cc @bobcatfish @vdemeester @pivotal-nader-ziada |
agree with @shashwathi, makes more sense in the |
@shashwathi Sure, I can change that. |
/ok-to-test |
@vdemeester will do - I might be a bit slow to respond in the next week or so, but I'll be back at it asap. |
I'm noticing a trend where it feels like we are slowly adding more and more pod attributes to both our TaskRuns and PipelineRuns. Should we:
I added this to the working group agenda for next week in case we want to discuss more out loud. If you folks agree I'm happy to create an issue to deal with allowing a user to specify all the pod attributes they could possibly want. ((Also im not very familiar with these pod attributes so I think I'm not totally clear on when they come into play so probably someone more informed than me will have better opinions here!)) |
@bobcatfish I think your 2nd idea would be great to have but perhaps the two implementations may be needed. Correct me if I'm wrong but my interpretation of "pod template" would be similar of this kubernetes feature : this gives a global preset way of how we are going to have each pods created as defined by the adminstrator. But perhaps for some specifics use case user would want to override this and that's where feature 1 would be able to help us. For example an administrator may want to set a default securityContext to have all pods running as user and then use a pod preset/template that by default does this. But in some case user would need to run with a different securityContext (i.e: with privliged mode) for example when running kaniko or another container image building tools and then may wants to override it in her template to allows it. Just my 2c and food for thoughts before next week meeting. |
Checking in here - was there a conclusion reached on how to move forward with this PR and/or the more generic templating solution? @bobcatfish @chmouel @vdemeester |
@tekton-robot yes, if you rebase, now that #767 is merged, you should be able to move the |
@vdemeester If I read properly #767 those templates apply to all the containers specified in the tasks, If i have a use case like this :
I think Alex's PR allows to override the "global template', which would be usefull to address that use case. We could maybe improve on this in the future and allow instead a task to specify a label that match another template, for example you could say from the task I was to apply the |
Hmm, looking at #767 it only allows specifying the container security context right? I'll have to do some testing, but I think we might need some of the |
For reference: |
@dicarlo2 we discussed this (pretty briefly!) in the most recent working group meeting, and this is where we landed:
|
Yeah I think we need to make a decision on this - since steps run inside a |
SGTM re: pod templates. Should we go ahead and close this PR then? FWIW - we still need this and are using it on a fork. |
@dicarlo2 since it's taking me ages to get around to making the proposal, and you are needing this now, I'm inclined to suggest we merge this the way it is now (since we've already got other pod/k8s specific attributes in the Runs, so we're not making it any worse) Would love a second opinion @vdemeester @dlorenc @imjasonh |
Can we also have field for Pod metadata so that we can specify seccomp and AppArmor annotations? |
@bobcatfish totally up to you, I honestly don't mind maintaining a fork with these changes in the meantime. |
@AkihiroSuda #894 should satisfy your use-case, you can set annotations on the Task/Pipeline, etc. and they will propagate. |
Okay whichever you prefer @dicarlo2 ! In the meantime @vdemeester said he was going to take on proposing the pod template which I have continued to not get around to proposing 😇 |
@vdemeester is adding |
Changes
Add
securityContext
to TaskSpec. Alternatives considered: add to PipelineRun and TaskRun - rejected because the security context a task runs in should not change from run to run.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.
Release Notes