-
Notifications
You must be signed in to change notification settings - Fork 1.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
CORS-3883: Azure Machine Identity API #9538
base: main
Are you sure you want to change the base?
CORS-3883: Azure Machine Identity API #9538
Conversation
Removes automatic creation of the user-assigned identity, as it is no longer required to authenticate the cloud-provider (CCM handles this). All subsequent identity-VM relationships will be handled directly through CAPZ. Subsequent commits will mirror the CAPZ API to the install config.
@patrickdillon: This pull request references CORS-3883 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.19.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@patrickdillon: This pull request references CORS-3883 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.19.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
f10fb05
to
a4ea8d7
Compare
Adds types to the machinepool in order to allows users to specify how identities on control plane and compute nodes should be handled.
By default, we will not use an identity on nodes.
Updates control-plane machine manifests to use the identities specified in the install config machinepools. The MAPI API for identities is very basic, and expects to only use an identity within the same resource group as the cluster. Currently the installer only allows installing into an empty resource group so it is not possible for users to BYO identity with MAPI. That is fine for the time being as there is no known use for having an identity attached to compute nodes. We can resolve this in future work, particularly with the MAPI->CAPI transition.
go mod tidy go mod vendor
a4ea8d7
to
329c047
Compare
This commit removes the SDK-based creation of the resource group and depends on CAPZ to reconcile the resource group. Doing this reduces the amount of code we need to maintain and simplifies the Azure Stack implementation so that we don't need to worry about setting the API version for this client.
I was going to open a new PR, branched off this one, for[ CORS-3861](https://issues.redhat.com/browse/CORS-3861), which refactors our code to use CAPZ to reconcile resource groups rather than creating with an SDK. I decided that it is simple enough that I should just stick it on the end of this one, so I added that in 90f61a0 |
@patrickdillon: This pull request references CORS-3883 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
Do we want to add validations around the new install-config identity parameters? |
@patrickdillon: The following tests failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
Most significantly, this PR removes the automatic creation of the cluster identity which was attached to control-plane and compute nodes. This identity was originally created in order to authenticate the in-tree cloud-provider-azure. When cloud-provider-azure moved out-of-tree and under the management of the CCMO, it began to use credentials requests to authenticate.
The identity we create for that purpose is now unused. By removing the creation of the identity, we can reduce the permissions required to run an Azure install, paritcularly the User Access Administrator role, which is a significant role.
This PR also extends CAPZ's identity API into the install config machine pool to allow users to customize the identities attached to VMs. The identity will default to
None
, but we also allow users to BYOUserAssigned
identities or to have Azure create aSystemAssigned
identity.For example:
uses an existing identity called
test-capi-id
from theos4-common
resource group.Will create a system-assigned identity and attach it to the VM. It defaults to a contributor role. The system-assigned identity role can also be customized:
Will give the system-assigned identity the Owner role (the value for
definitionID
corresponds to the owner role). This will also work for custom roles.008926c removes any identity from being attached to compute nodes. To configure an identity in MAPI, MAPI expects a user-assigned identity in the machine's resource group. That would only be possible when installing to an existing resource group, but the installer enforces that resource group to be empty. This can be addressed in future work, particularly the MAPI->CAPI transition will allow us to extend this API directly to compute nodes.