-
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
Proposal: Per-resource Service Accounts #1371
Comments
I assume this means outside of |
Yeah, I envisioned someone wanting to run the main |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. 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. |
/remove-lifecycle rotten |
@vdemeester: Reopened this issue. 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. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. 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. |
Is there some way to create a per-pipelinerun service account? |
Today, to authorize interactions with PipelineResources (e.g., fetch source, push image, deploy to cluster), a TaskRun specifies a Service Account, which is expected to have an annotated Secret with credentials to interact with all the external services needed by the TaskRun.
These credentials are pulled from the Secret and passed to
creds-init
before the steps run, to populate.gitconfig
s,~/.docker/config.json
s, SSH keys, etc. (full docs)The result is that a TaskRun has a single Service Account, with permission to do all the things the TaskRun needs to do, and all of that Service Account's properly-annotated Secrets are made available to all of the run's steps and resources.
This can be confusing in cases where there are many resources involved that require credentials. There might be multiple resources of the same time (git, image, cluster) that might be able to be authorized by multiple available credentials, and removing one might have unintended consequences if they were unexpectedy load-bearing. A TaskRun might want to fetch source before running steps using a read-only auth token, then do some work, then push to the repo afterwards using a different read-write token. Or a Service Account might be used for many TaskRuns, and have all the credentials needed for all of the Tasks it can possibly run mounted into every TaskRun.
Proposal
Optionally allow PipelineResource definitions to specify a Service Account (or just a Secret? Or multiple Secrets?) to use to interact with that resource, which would populate credentials in the expected place(s) only for the duration of that interaction. After the resource interaction is done, the TaskRun's otherwise configured Service Account would take over to perform the rest of the steps and interact with resources.
(The per-resource credentials are instead of the TaskRun's credentials, not in addition to)
PipelineResource implementations should not have to be aware of credentials, just as they aren't today -- they should be able to assume the presence of required credentials, and it should be the responsibility of the controller to run
creds-init
correctly before the resource's containers run to make sure the expected credentials are present, and that they're not present when they aren't requested.Considerations
This opens a possible door to having per-step Service Accounts, or per-step Secrets, which would similarly populate credentials only for the duration of that step, then revert to fallback credentials for the rest of the run. This feels like overkill to me, and would need to be justified by sufficient user feedback.
The text was updated successfully, but these errors were encountered: