-
Notifications
You must be signed in to change notification settings - Fork 132
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 web identity token configuration to ProviderConfig spec #1148
add web identity token configuration to ProviderConfig spec #1148
Conversation
308961b
to
1d55074
Compare
/test-examples="examples/iam/v1beta1/role.yaml" |
1d55074
to
6481d0c
Compare
/test-examples="examples/ec2/v1beta1/vpc.yaml" |
Manually tested:
Upbound SaaS is also tested by @turkenf |
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.
Thanks @erhancagirici for working on the ProviderConfig. Left some comments for you to consider.
6481d0c
to
8abf565
Compare
/test-examples="examples/ec2/v1beta1/vpc.yaml" |
Signed-off-by: Erhan Cagirici <[email protected]>
8abf565
to
7d4f382
Compare
Signed-off-by: Erhan Cagirici <[email protected]>
/test-examples="examples/ec2/v1beta1/vpc.yaml" |
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.
Thanks @erhancagirici, lgtm.
Description of your changes
Adds support for Web Identity token configuration from
ProviderConfig
Fixes #1007
Currently Web Identity authentication configuration is only possible with
AWS_WEB_IDENTITY_TOKEN_FILE
andAWS_ROLE_ARN
environment variables set.This causes confusion and ambiguity in several ways and has limitations:
spec.credentials.webIdentity.roleARN
, they still need to specify the same role ARN atAWS_ROLE_ARN
environment variable to make it work. As reported in WebIdentity credential source relies on eks.amazonaws.com/role-arn ServiceAccount annotation #1007, this seems like the users depend on IRSA annotations, however it is actually a dependency toAWS_ROLE_ARN
andAWS_WEB_IDENTITY_TOKEN_FILE
environment variables. When consumers do IRSA config, these env vars are automatically set, which satisfies the config.AWS_WEB_IDENTITY_TOKEN_FILE
AWS_ROLE_ARN
which emits uninformative errors.ProviderConfig
and token through env.ControllerConfig
s (deprecated) orDeploymentRuntimeConfig
s to mount token files and inject env vars to provider pods.This change expands
ProviderConfig
API specification withspec.credentials.webIdentity.tokenConfig
, with options to reference a secret or filesystem location for the token to be used forAssumeRoleWithWebIdentity
operations.Consumers can specify the token's source (
Secret
orFilesystem
) and setsecretRef
orfs
respectively.Example Web identity token configuration with Web Identity Token from a secret:
example using a filesystem location. Note that
Filesystem
source option still needs the token file mounted to the filesystem of the provider pod.The difference is that new API allows specifying the token file per
ProviderConfig
, meaning that you can mount multiple tokens to the provider pod and reference the desired one at eachProviderConfig
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Tested with provided examples in the PR description for the new feature and uptest for regressions