-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Support AutomountServiceAccountToken #1480
Merged
jessesuen
merged 15 commits into
argoproj:master
from
dtaniwaki:automount-service-account
Aug 21, 2019
Merged
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fa96696
Support AutomountServiceAccountToken
dtaniwaki 94d2828
Disallow automountServiceAccountToken in resource templates
dtaniwaki 9d12235
Support ServiceAccountTokenName for init/wait containers
dtaniwaki 3a87b5a
Add a test for ServiceAccountTokenName
dtaniwaki 2a47ec8
Fix wrong condition of AutomountServiceAccountToken check
dtaniwaki 7601f69
Fix lint error
dtaniwaki 0de424f
Implement ExecutorServiceAccountTokenName
dtaniwaki f32ffcd
Fix unexpected volume mounts overwritten
dtaniwaki 1498c3c
Merge remote-tracking branch 'upstream/master' into automount-service…
dtaniwaki 2dc2728
Remove test fields
dtaniwaki ef19bb2
Support ExecutorServiceAccountName instead of ExecutorServiceAccountT…
dtaniwaki 8039fa5
Merge remote-tracking branch 'upstream/master' into automount-service…
dtaniwaki fce2316
Structure executor config
dtaniwaki 75e5f0b
Fix lint failure
dtaniwaki 2e734a6
Stop getting actual secrets to find a service account token name
dtaniwaki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@dtaniwaki - i was thinking, instead of
executorServiceAccountTokenName
, should this reference a service account name instead (i.e.executorServiceAccountName
) and we would have the controller look up the the secret name from the service account for the volume mount? (similar to how serviceAccountName works)This seems like it would be more user-friendly since users do not generally create tokens, they create service accounts. Note that this would require expanding the privileges of the controller to have read permissions on service accounts.
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.
Agree. I will change it.
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.
If we use
ExecutorServiceAccountName
instead ofExecutorServiceAccountTokenName
, do you thinkAutomountServiceAccountToken
still make sense to only disable automount service account token on the main container?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.
FYI
Found the corresponded code in Kubernetes
https://github.com/kubernetes/kubernetes/blob/b8eecd671d7d895ecd4f0fc6930b82e55298e257/plugin/pkg/admission/serviceaccount/admission.go#L327-L349
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.
Yes. I think the following should disable mounting of service accounts entirely (in both main and wait):
and the following will disable it on main, but mount a different service account for the executor:
And the following would use separate service accounts for main and wait
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.
Sounds good.
I realized we need to add read permission for service accounts to the cluster role.
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.
For the following case:
We can't run a workflow because the current executor needs a service account token during the initialization, so I made it cause an error during validation.