-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Added support for azure workload identity #5390
Added support for azure workload identity #5390
Conversation
Welcome @stijndehaes! |
f8126b7
to
8b045b1
Compare
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.
Thank you for your contribution! Could you please describe the use case this is targeting (or link to an existing issue)?
if tenantId := os.Getenv("AZURE_TENANT_ID"); tenantId != "" { | ||
cfg.TenantID = tenantId | ||
} | ||
cfg.AADClientID = os.Getenv("ARM_CLIENT_ID") | ||
if clientId := os.Getenv("AZURE_CLIENT_ID"); clientId != "" { | ||
cfg.AADClientID = clientId | ||
} |
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.
This lets one override ARM_TENANT/CLIENT_ID
with AZURE_TENANT/CLIENT_ID
. It is not clear why supporting this is needed (if there is a good reason, please explain) and it introduces (an admittedly small) risk of breaking existing deployments. Most importantly, this is not related to introducing workload identity, which is the target of this PR. Please remove, and - if there is a good reason - introduce in a separate PR.
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.
why doing an override here?
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.
These override are here because of the project https://github.com/Azure/azure-workload-identity,
The default environment values it sets are:
- AZURE_TENANT_ID
- AZURE_CLIENT_ID
- AZURE_FEDERATED_TOKEN_FILE
- AZURE_AUTHORITY_HOST
To have better interoperability I added these aliases. I can remove them though and add them in a new PR
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 for sharing the contexts, it makes sense.
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.
@feiskyer thank you for the feedback!
# azureUseWorkloadIdentityExtension -- Whether to use Azure's workload identity extension for credentials. | ||
azureUseWorkloadIdentityExtension: false | ||
|
||
# azureUseManagedIdentityExtension -- Whether to use Azure's managed identity extension for credentials. If using MSI, ensure subscription ID, resource group, and azure AKS cluster name are set. | ||
azureUseManagedIdentityExtension: false |
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.
Only one of these can be used at a time (if both are set, the current implementation will use workload identity). Please document (and consider adding a check in code that both are not set at the same time).
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.
I added an error in the code, and added documentation that you should not set both
/label area/provider/azure |
@tallaxes: The label(s) 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. |
/area provider/azure |
@@ -95,6 +95,9 @@ azureClusterName: "" | |||
# Required if `cloudProvider=azure` | |||
azureNodeResourceGroup: "" | |||
|
|||
# azureUseWorkloadIdentityExtension -- Whether to use Azure's workload identity extension for credentials. | |||
azureUseWorkloadIdentityExtension: false |
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.
+1 to mention here WorkloadIdentity couldn't be used together with other author approaches.
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.
And how AADFederatedTokenFile
could be set in the helm chart?
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.
I added documentation to the readme
8b045b1
to
2f3fb3f
Compare
24a3d4b
to
e9366fd
Compare
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.
/lgtm
@gjtempleton could you help to review the charts changes? |
@gjtempleton friendly reminder to help with the review of the chart changes :) |
/lgtm |
/assign @gjtempleton |
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.
/lgtm
/assign @gjtempleton |
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.
One request and a couple of tiny typos, but otherwise this LGTM, thanks for the PR!
e9366fd
to
5959e07
Compare
@gjtempleton I implemented the changes! Thank you for the review. |
@gjtempleton @tallaxes @feiskyer Can you guys give me a last LGTM or tell me what needs to be changed still? :) |
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.
/lgtm
704857d
to
ef295a3
Compare
@gjtempleton thank you for checking, I have made the changes. If ok can you approve? @feiskyer I am going to need your approval again sorry for this. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, gjtempleton, stijndehaes, tallaxes 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 |
Which component this PR applies to?
What type of PR is this?
/kind feature
What this PR does / why we need it:
It adds support for workload identity to the cluster autoscaler on azure
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: