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 support for managed identity in machine pool #1004

Merged
merged 1 commit into from
Oct 27, 2020

Conversation

shysank
Copy link
Contributor

@shysank shysank commented Oct 20, 2020

What type of PR is this?
/kind feature

What this PR does / why we need it:
Adds support for managed identity in machine pool.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #960

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release Note:

Add support for managed identity in machine pool

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 20, 2020
@k8s-ci-robot k8s-ci-robot added area/provider/azure Issues or PRs related to azure provider needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 20, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @shysank!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-azure 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-azure has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @shysank. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 20, 2020
@shysank shysank marked this pull request as ready for review October 21, 2020 16:52
@nader-ziada
Copy link
Contributor

/cc @devigned

@k8s-ci-robot k8s-ci-robot requested a review from devigned October 21, 2020 17:53
Copy link
Contributor

@nader-ziada nader-ziada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @shysank

a couple of quick questions


// ErrUserAssignedIdentitiesNotFound is the error thrown when user assigned identities is not passed with the identity type being UserAssigned
var ErrUserAssignedIdentitiesNotFound = errors.New("the user-assigned identity provider ids must not be null or empty for 'UserAssigned' identity type")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this converter to just generate the resource id in the azure format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just a helper for converting []UserIdentity to map[string]VmOrVmssIdentityStruct

@nader-ziada
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 21, 2020
@nader-ziada
Copy link
Contributor

@devigned can you take a look please

@nader-ziada
Copy link
Contributor

@shysank if you think the PR is ready, can you please remove the [WIP] and add a release note in the PR description.

Copy link
Contributor

@devigned devigned left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. I have some light feedback about the code and documentation.

One thing I would like to see out of this PR is a tutorial in the CAPZ book to describe how to create a MachinePool with a user assigned identity with a link to building a user assigned identity.

@@ -717,6 +717,188 @@ func TestReconcileVMSS(t *testing.T) {
s.SetProvisioningState(infrav1.VMStateSucceeded)
},
},
{
name: "can create a vmss with user assigned identity",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action in the PR, but more for maintainers.

Dang... these tests are verbose with only like 2 lines that need to be updated. It would be nice to dry these up.

cc: @CecileRobertMichon and @nader-ziada

cloud/converters/identity.go Outdated Show resolved Hide resolved
cloud/converters/identity_test.go Outdated Show resolved Hide resolved
cloud/converters/identity_test.go Outdated Show resolved Hide resolved
@CecileRobertMichon
Copy link
Contributor

re: documentation, you could add onto the existing Identity doc https://capz.sigs.k8s.io/topics/identity.html

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 22, 2020
@shysank
Copy link
Contributor Author

shysank commented Oct 22, 2020

/retitle ✨ Add support for managed identity in machine pool

@k8s-ci-robot
Copy link
Contributor

@shysank: Re-titling can only be requested by trusted users, like repository collaborators.

In response to this:

/retitle ✨ Add support for managed identity in machine pool

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.

@shysank shysank changed the title [WIP] ✨ Add support for managed identity in machine pool ✨ Add support for managed identity in machine pool Oct 22, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 22, 2020
@shysank
Copy link
Contributor Author

shysank commented Oct 22, 2020

@devigned I've addressed the review comments, PTAL.
cc: @CecileRobertMichon @nader-ziada

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 22, 2020
Copy link
Contributor

@devigned devigned left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nader-ziada
Copy link
Contributor

lgtm pending squashing commits

@CecileRobertMichon
Copy link
Contributor

/retest

looks like an unrelated flake

@shysank shysank force-pushed the fix/960 branch 2 times, most recently from 87d91b7 to af862a5 Compare October 26, 2020 18:09
@shysank
Copy link
Contributor Author

shysank commented Oct 26, 2020

@CecileRobertMichon I have made the role assignment changes for system assigned identity, PTAL. The api-diff script is failing because I modified the Validate method to accept old machine pool spec as a parameter.

@nader-ziada
Copy link
Contributor

I think its lgtm pending squashing commits

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, please squash the commits @shysank

Awesome work, thanks!

@k8s-ci-robot
Copy link
Contributor

@shysank: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-provider-azure-apidiff b463637 link /test pull-cluster-api-provider-azure-apidiff

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@shysank
Copy link
Contributor Author

shysank commented Oct 26, 2020

@nader-ziada @CecileRobertMichon Thanks for the review, I've squashed the commits.

@CecileRobertMichon
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2020
Copy link
Contributor

@devigned devigned left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: devigned

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2020
@k8s-ci-robot k8s-ci-robot merged commit 7aae523 into kubernetes-sigs:master Oct 27, 2020
@k8s-ci-robot k8s-ci-robot added this to the v0.4.10 milestone Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for managed identity with AzureMachinePool
5 participants