-
Notifications
You must be signed in to change notification settings - Fork 2k
[OSDOCS-19523]: Setting up a management cluster for HCP on Azure #112346
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
Merged
dfitzmau
merged 1 commit into
openshift:main
from
lahinson:osdocs-19523-hcp-azure-mgmt-cluster
Jun 10, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,224 @@ | ||
| //Module included in the following assemblies: | ||
| // hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="hcp-azure-mgmt-cluster_{context}"] | ||
| = Configuring an {azure-short} management cluster for {hcp} | ||
|
|
||
| [role="_abstract"] | ||
| To configure the management cluster for {hcp} on {azure-short}, you need to ensure that external DNS and the HyperShift Operator are set up on the cluster. | ||
|
|
||
| The configuration steps include configuring the DNS zone, delegating the DNS records for your cluster, and creating a dedicated service principal for external DNS. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You installed the {mce-short} 2.5 or later on an {product-title} cluster. You can install {mce-short} as an Operator from the {product-title} software catalog. Or, if you already use {rh-rhacm-title}, the Operator is automatically installed. The HyperShift Operator is enabled by default in the operator package for {mce-short}. | ||
|
|
||
| * The {azure-short} command-line interface (CLI) is installed and configured. | ||
|
|
||
| * The {oc-first} is installed. | ||
|
|
||
| * You have an {product-title} management cluster on {azure-short}. | ||
|
|
||
| * If you are using external DNS, the `jq` command-line JSON processor is installed. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Set the DNS configuration variables as shown in the following example: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| PARENT_DNS_RG="<my_parent_dns_resource_group>" | ||
| PARENT_DNS_ZONE="<my_parent.dns.zone.com>" | ||
| DNS_RECORD_NAME="<my_subdomain>" | ||
| RESOURCE_GROUP_NAME="<my_resource_group>" | ||
| DNS_ZONE_NAME="<my_subdomain.my_parent.dns.zone.com>" | ||
| LOCATION="<my_region>" | ||
| ---- | ||
|
|
||
| . Create the {azure-short} group by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ az group create \ | ||
| --name $RESOURCE_GROUP_NAME \ | ||
| --location $LOCATION | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
|
|
||
| . Create the {azure-short} DNS zone by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ az network dns zone create \ | ||
| --resource-group $RESOURCE_GROUP_NAME \ | ||
| --name $DNS_ZONE_NAME | ||
| ---- | ||
|
|
||
| . If an existing name server record exists, delete it by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ az network dns record-set ns delete \ | ||
| --resource-group $PARENT_DNS_RG \ | ||
| --zone-name $PARENT_DNS_ZONE \ | ||
| --name $DNS_RECORD_NAME -y | ||
| ---- | ||
|
|
||
| . Get the name servers from your DNS zone by entering the following command: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| name_servers=$(az network dns zone show \ | ||
| --resource-group $RESOURCE_GROUP_NAME \ | ||
| --name $DNS_ZONE_NAME \ | ||
| --query nameServers \ | ||
| --output tsv) | ||
| ---- | ||
|
|
||
| . Create an array of name servers as shown in the following example: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
| ns_array=() | ||
| while IFS= read -r ns; do | ||
| ns_array+=("$ns") | ||
| done <<< "$name_servers" | ||
| ---- | ||
|
|
||
| . Add name server records to the parent zone as shown in the following example: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
| for ns in "${ns_array[@]}"; do | ||
| az network dns record-set ns add-record \ | ||
| --resource-group $PARENT_DNS_RG \ | ||
| --zone-name $PARENT_DNS_ZONE \ | ||
| --record-set-name $DNS_RECORD_NAME \ | ||
| --nsdname "$ns" | ||
| done | ||
| ---- | ||
|
|
||
| . Set the external DNS configuration variables as shown in the following example: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| EXTERNAL_DNS_NEW_SP_NAME="<external_dns_service_principal>" | ||
| SERVICE_PRINCIPAL_FILEPATH="<path_to_azure_mgmt_json_file>" | ||
| RESOURCE_GROUP_NAME="<my_resource_group>" | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
|
|
||
| . Create the service principal for external DNS by entering the following command: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| DNS_SP=$(az ad sp create-for-rbac --name ${EXTERNAL_DNS_NEW_SP_NAME}) | ||
| EXTERNAL_DNS_SP_APP_ID=$(echo "$DNS_SP" | jq -r '.appId') | ||
| EXTERNAL_DNS_SP_PASSWORD=$(echo "$DNS_SP" | jq -r '.password') | ||
| ---- | ||
|
|
||
| . Get the DNS zone ID by entering the following command: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
| DNS_ID=$(az network dns zone show \ | ||
| --name ${DNS_ZONE_NAME} \ | ||
| --resource-group ${RESOURCE_GROUP_NAME} \ | ||
| --query "id" \ | ||
| --output tsv) | ||
| ---- | ||
|
|
||
| . Assign the `Reader` role to the service principal by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ az role assignment create \ | ||
| --role "Reader" \ | ||
| --assignee "${EXTERNAL_DNS_SP_APP_ID}" \ | ||
| --scope "${DNS_ID}" | ||
| ---- | ||
|
|
||
| . Assign the `Contributor` role to the service principal by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ az role assignment create \ | ||
| --role "Contributor" \ | ||
| --assignee "${EXTERNAL_DNS_SP_APP_ID}" \ | ||
| --scope "${DNS_ID}" | ||
| ---- | ||
|
|
||
| . Create the content for the {azure-short} credentials file as shown in the following example: | ||
| + | ||
| [source,json] | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
| { | ||
|
lahinson marked this conversation as resolved.
|
||
| "tenantId": "$(az account show --query tenantId -o tsv)", | ||
| "subscriptionId": "$(az account show --query id -o tsv)", | ||
| "resourceGroup": "$RESOURCE_GROUP_NAME", | ||
| "aadClientId": "$EXTERNAL_DNS_SP_APP_ID", | ||
| "aadClientSecret": "$EXTERNAL_DNS_SP_PASSWORD" | ||
| } | ||
| ---- | ||
|
|
||
| . Create the credentials file by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f <service_principal_filepath>.json | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
|
|
||
| . If an existing Kubernetes secret for the {azure-short} credentials exists, delete it by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc delete secret/azure-config-file --namespace "default" || true | ||
| ---- | ||
|
|
||
| . Create the Kubernetes secret for the {azure-short} credentials by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc create secret generic azure-config-file \ | ||
| --namespace "default" \ | ||
| --from-file ${SERVICE_PRINCIPAL_FILEPATH} | ||
| ---- | ||
|
|
||
| . Configure the HyperShift Operator to use external DNS by creating the following `ConfigMap` object: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: hypershift-operator-install-flags | ||
| namespace: local-cluster | ||
| data: | ||
| installFlagsToAdd: "--external-dns-provider=azure --external-dns-credentials <secret> --external-dns-domain-filter <dns_zone>" | ||
| installFlagsToRemove: "" | ||
| ---- | ||
| + | ||
| The `data.installFlagsToAdd` parameter specifies the flags to pass to the Operator so it detects the DNS. | ||
|
|
||
| . Apply the config map by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f hypershift-operator-install-flags.yaml | ||
| ---- | ||
|
|
||
| .Verification | ||
|
|
||
| * Verify that both the HyperShift Operator and the external DNS are running by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc get pods -n hypershift | ||
| ---- | ||
| + | ||
| .Example output | ||
|
lahinson marked this conversation as resolved.
|
||
| [source,terminal] | ||
| ---- | ||
| NAME READY STATUS RESTARTS AGE | ||
| external-dns-xxxxx-xxxxx 1/1 Running 0 1m | ||
| operator-xxxxx-xxxxx 1/1 Running 0 1m | ||
| ---- | ||
|
lahinson marked this conversation as resolved.
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.