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

Bind admin role so that SA can use PSP #863

Merged
merged 1 commit into from
Jan 12, 2021

Conversation

fiunchinho
Copy link
Contributor

Changes

Examples fail because the ServiceAccount used has no permissions to use the PodSecurityPolicy. We need to bind the admin role to the ServiceAccount so that it can use the PSP.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

@tekton-robot
Copy link

@fiunchinho: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

@tekton-robot tekton-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Dec 15, 2020
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 15, 2020

CLA Signed

The committers are authorized under a signed CLA.

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 15, 2020
@tekton-robot
Copy link

Hi @fiunchinho. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 15, 2020
@dibyom
Copy link
Member

dibyom commented Dec 15, 2020

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 15, 2020
@@ -37,6 +37,18 @@ roleRef:
kind: Role
name: tekton-triggers-example-minimal
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding a binding to the admin role, could we add the rule of using pod security policies to the role defined above in this file?

@dibyom
Copy link
Member

dibyom commented Dec 15, 2020

Question: Is this needed due to #862?

Also, /cc @gabemontero our resident PSP expert!

@gabemontero
Copy link
Contributor

Question: Is this needed due to #862?

Yes I believe it is @dibyom .... the slack discussion thread we've had with these folks on their issue is https://tektoncd.slack.com/archives/CKUSJ2A5D/p1607949867225500

Subsequent to getting this to work for them, I am curious how long triggers has been broke with PSP turned on. Or if it ever worked with PSP turned on. I would think it had worked with PSP sometime in the past but am not certain. If it did, that might mean something changed in the image or controller to necessitate these changes.

By comparison, the PSP analogous feature in openshift, SCC, (which is what I typically run with), has not seen this (unless we need to retry with the very latest ... it has been a couple of weeks for me). @savitaashture attested to the same experience.

Also, /cc @gabemontero our resident PSP expert!

oooh, that is a very dangerous characterization man ;-) .... "expert" at best is a relative term here :-)

@dibyom
Copy link
Member

dibyom commented Dec 15, 2020

Subsequent to getting this to work for them, I am curious how long triggers has been broke with PSP turned on. Or if it ever worked with PSP turned on. I would think it had worked with PSP sometime in the past but am not certain. If it did, that might mean something changed in the image or controller to necessitate these changes.

well, #862 got merged yesterday so I'm guessing since then 😛 The conroller/webhook already had roles to use PSPs. The EL sink deployment did not have this role, but the deployment spec also did not have a securityContext (until yesterday).

@gabemontero
Copy link
Contributor

Subsequent to getting this to work for them, I am curious how long triggers has been broke with PSP turned on. Or if it ever worked with PSP turned on. I would think it had worked with PSP sometime in the past but am not certain. If it did, that might mean something changed in the image or controller to necessitate these changes.

well, #862 got merged yesterday so I'm guessing since then stuck_out_tongue The conroller/webhook already had roles to use PSPs. The EL sink deployment did not have this role, but the deployment spec also did not have a securityContext (until yesterday).

the opposite actually ... I suggested that to them, along with this PR, to help get past this ... basically mimic what we do for the controller / webhook ... they were seeing the issue before that merged

@dibyom
Copy link
Member

dibyom commented Dec 15, 2020

Makes sense. controllers/webhook had the right policies/securityContext while EL sinks did not. So in environments requiring PSPs, the controller/webhook would work but not the EL.

@MarcelMue
Copy link
Member

I will take over this PR from @fiunchinho - he is currently on vacation but I'd like to push this forward in the meantime.

@dibyom
Copy link
Member

dibyom commented Jan 6, 2021

I will take over this PR from @fiunchinho - he is currently on vacation but I'd like to push this forward in the meantime.

Thank you 🙏

@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 11, 2021
@fiunchinho
Copy link
Contributor Author

Addressed review comment, please take a look. Thanks.

@dibyom
Copy link
Member

dibyom commented Jan 11, 2021

Looks good. One small thing -- could you squash up the two commits? Thanks!

/approve

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 11, 2021
@dibyom dibyom added release-note-none Denotes a PR that doesnt merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 11, 2021
@fiunchinho
Copy link
Contributor Author

Looks good. One small thing -- could you squash up the two commits? Thanks!

/approve

Done

@dibyom
Copy link
Member

dibyom commented Jan 12, 2021

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2021
@tekton-robot tekton-robot merged commit 7d49df4 into tektoncd:master Jan 12, 2021
@MarcelMue
Copy link
Member

Nice 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesnt merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants