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

add helper function for creating iam service account #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Rob-Johnson
Copy link
Contributor

copies the implementation added by @JoeMalt for the flink operator, and moves it to paasta-tools-go.

caveat: I've removed the 'prefix' thing from the original implementation, given this is already namespaced.

also added a helper function for getting the object hash from a k8s object, given you currently have to access the correct label directly.

open question: should we try and add/delete the service account if the object hash doesn't match (currently we're just looking if one with a matching name exists)?

provides a helper function for retrieving the correct label from an
arbitrary k8s object
creates a service account suitable for use with with aws iam oidc
providers.
@vkhromov
Copy link
Contributor

vkhromov commented Feb 4, 2021

caveat: I've removed the 'prefix' thing from the original implementation, given this is already namespaced.

The prefix is used in paasta-tools code to reduce a chance to have name collision between generated-for-iam-roles SA names and some other SA names, so it's better to have the same prefix here as well.

also added a helper function for getting the object hash from a k8s object, given you currently have to access the correct label directly.

open question: should we try and add/delete the service account if the object hash doesn't match (currently we're just looking if one with a matching name exists)?

Why we need the hash in the first place?

Overall, I planned to move https://github.yelpcorp.com/services/flink-operator/blob/master/pkg/cluster/common.go#L48 into paasta-tools-go as well, and remove all implementation-specific details from the operator code, so it would just call functions like Init and ModifyPodForIamRole. For that, EnsureServiceAccountForIamRole will become that Init and will abstract most of its arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants