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

enable HYPERSHIFT_AZURE_ASSIGN_SERVICE_PRINCIPAL_ROLES and remove skip-service-principal-deletion param #60346

Closed

Conversation

heliubj18
Copy link
Contributor

  1. enable HYPERSHIFT_AZURE_ASSIGN_SERVICE_PRINCIPAL_ROLES
  2. remove skip-service-principal-deletion param to fix e2e failures

Copy link
Contributor

openshift-ci bot commented Jan 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: heliubj18
Once this PR has been reviewed and has the lgtm label, please assign liangquanli930 for approval. For more information see the Code Review Process.

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

@openshift-ci openshift-ci bot requested review from csrwng and jianlinliu January 6, 2025 16:18
@heliubj18 heliubj18 force-pushed the enable-auto-assign-role branch from 8d00731 to dd3289a Compare January 6, 2025 16:27

client_id="$(eval "az ad sp create-for-rbac --name $name --role Contributor --scopes $scopes --create-cert --cert $name --keyvault $KV_NAME --output json --only-show-errors" | jq -r '.appId')"
client_id="$(eval "az ad sp create-for-rbac --name $name --create-cert --cert $name --keyvault $KV_NAME --output json --only-show-errors" | jq -r '.appId')"
echo "$client_id" >> "${SHARED_DIR}/azure_sp_id"

component_to_client_id+=(["$component"]="$client_id")
component_to_cert_name+=(["$component"]="$name")
done

# TODO: Remove this once the we used the automated role assignment by "--assign-service-principal-role"
Copy link
Member

Choose a reason for hiding this comment

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

Should this whole block just be removed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here it prepares one managed identity file hypershift_azure_mi_file.json used in the azure provision chain when HYPERSHIFT_AZURE_CP_MI is true and it is also needed by HYPERSHIFT_AZURE_ASSIGN_SERVICE_PRINCIPAL_ROLES


https://github.com/openshift/hypershift/blob/92bbcedfa4951be1c4edbba6465342a37fb6fda7/cmd/infra/azure/create.go#L223

And in the hypershift validation, this HYPERSHIFT_AZURE_CP_MI is needed when TechPreviewEnabled is enabled. So I have to keep that logic here.
https://github.com/openshift/hypershift/blob/001b0daa3ceecb87ab0a3388b4cff40338b7d633/cmd/cluster/azure/create.go#L141

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bryan-cox One question: If we don't prepare the service principal in advance, is there another step or a specific area within Hypershift that handles the creation of service principals? Thank you!

Copy link
Member

Choose a reason for hiding this comment

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

No, we removed the creation of SPs on purpose as it contributes to Azure quota issues. The direction from Red Hat and Microsoft were to reuse SPs as much as we can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I will prepare some permanent SPs manually and store them into the vault to use them in the step. thanks

@heliubj18 heliubj18 force-pushed the enable-auto-assign-role branch from dd3289a to 33190d4 Compare January 6, 2025 16:54
@heliubj18
Copy link
Contributor Author

/pj-rehearse periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-ephemeral-creds-guest-f7

@openshift-ci-robot
Copy link
Contributor

@heliubj18: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@heliubj18 heliubj18 force-pushed the enable-auto-assign-role branch from 33190d4 to 1646369 Compare January 6, 2025 18:24
@openshift-ci-robot
Copy link
Contributor

[REHEARSALNOTIFIER]
@heliubj18: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-hypershift-main-e2e-azure-aks-ovn-conformance openshift/hypershift presubmit Registry content changed
pull-ci-openshift-hypershift-release-4.20-e2e-azure-aks-ovn-conformance openshift/hypershift presubmit Registry content changed
pull-ci-openshift-hypershift-release-4.19-e2e-azure-aks-ovn-conformance openshift/hypershift presubmit Registry content changed
pull-ci-openshift-hypershift-release-4.18-e2e-azure-aks-ovn-conformance openshift/hypershift presubmit Registry content changed
pull-ci-openshift-hypershift-release-4.17-e2e-azure-aks-ovn-conformance openshift/hypershift presubmit Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-nightly-azure-aks-hypershift-ephemeral-creds-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.18-amd64-nightly-4.18-upgrade-from-stable-4.17-azure-aks-hypershift-registry-overrides-replace-guest-f28 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-full-cert-guest-f14 N/A periodic Registry content changed
periodic-ci-openshift-hypershift-release-4.19-periodics-e2e-azure-aks-ovn-conformance N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-4.19-upgrade-from-stable-4.18-azure-aks-hypershift-etcd-disk-encryption-replace-guest-f28 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-nightly-azure-aks-hypershift-registry-overrides-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.18-amd64-nightly-azure-aks-hypershift-disaster-recovery-infra-guest-f14 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-ephemeral-creds-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-cilium-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-ext-oidc-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-nightly-azure-aks-hypershift-ext-oidc-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.18-amd64-nightly-azure-aks-hypershift-etcd-disk-encryption-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.18-amd64-nightly-azure-aks-hypershift-ephemeral-creds-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-nightly-azure-aks-hypershift-byo-vnet-fips-guest-f7 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.18-amd64-nightly-azure-aks-hypershift-byo-vnet-fips-guest-f14-longduration N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-nightly-azure-aks-hypershift-byo-vnet-fips-mgmt-f14 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-rollback-nightly-azure-aks-hypershift-byo-vnet-replace-guest-f28 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-disaster-recovery-infra-guest-f14 N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-nightly-azure-aks-hypershift-byo-vnet-fips-guest-f14-destructive N/A periodic Registry content changed
periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-byo-vnet-fips-guest-f14-destructive N/A periodic Registry content changed

A total of 60 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs.

A full list of affected jobs can be found here

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

Copy link
Contributor

openshift-ci bot commented Jan 6, 2025

@heliubj18: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-ephemeral-creds-guest-f7 33190d4 link unknown /pj-rehearse periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-nightly-azure-aks-hypershift-ephemeral-creds-guest-f7

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.

@heliubj18
Copy link
Contributor Author

it can not work with HYPERSHIFT_AZURE_ASSIGN_SERVICE_PRINCIPAL_ROLES due to lack of az client in the HO image.
Confirmed with dev engineers, close this pr until the HO image includes the az cli
/close

@openshift-ci openshift-ci bot closed this Jan 8, 2025
Copy link
Contributor

openshift-ci bot commented Jan 8, 2025

@heliubj18: Closed this PR.

In response to this:

it can not work with HYPERSHIFT_AZURE_ASSIGN_SERVICE_PRINCIPAL_ROLES due to lack of az client in the HO image.
Confirmed with dev engineers, close this pr until the HO image includes the az cli
/close

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.

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.

3 participants