訓練
模組
使用 JSON ARM 範本部署 Azure 基礎結構 - Training
使用 Visual Studio Code 撰寫 JSON Azure Resource Manager 範本,一致又可靠地將基礎結構部署至 Azure。
本文說明如何使用 Azure Resource Manager 範本 (ARM 範本) 或 Bicep 來建立 Azure Red Hat OpenShift 叢集。 您可以使用 PowerShell 或 Azure 命令行介面 (Azure CLI) 來部署 Azure Red Hat OpenShift 叢集。
Azure Resource Manager 範本是一個 JavaScript 物件標記法 (JSON) 檔案,會定義專案的基礎結構和設定。 範本使用宣告式語法。 您可以描述預期的部署,而不需要撰寫程式設計命令順序來建立部署。
Bicep 是使用宣告式語法來部署 Azure 資源的特定領域語言 (DSL)。 在 Bicep 檔案中,您會定義要部署至 Azure 的基礎結構,然後在整個開發生命週期中使用該檔案,以重複部署您的基礎結構。 您的資源會以一致的方式進行部署。
注意
如需使用 Terraform 部署 Azure Red Hat OpenShift 叢集的詳細資訊,請參閱 Microsoft.RedHatOpenShift openShift openShiftClusters Terraform。
需要具作用中訂用帳戶的 Azure 帳戶。 若您還沒有帳戶,可以免費建立帳戶。
能夠指派「使用者存取系統管理員」和「參與者」角色。 如果您缺少這項權限,請連絡您的 Microsoft Entra 系統管理員來管理角色。
Red Hat 帳戶。 如果您沒有帳戶,則必須註冊帳戶。
Azure Red Hat OpenShift 叢集的提取秘密。 從 Red Hat OpenShift 叢集管理員網站下載提取秘密檔案 (英文)。
如果您想要在本機執行 Azure PowerShell 程式代碼,則需要 Azure PowerShell (部分機器翻譯)。
如果要在本機執行 Azure CLI 程式碼:
選擇 Azure Resource Manager 範本 (ARM 範本) 或 Azure Bicep 檔案。 然後,您可以使用 Azure 命令行 (azure-cli) 或 PowerShell 來部署範本。
下列範例展示在設定 Azure RedHat OpenShift 叢集時,ARM 範本完成的樣子。
範本會定義三個 Azure 資源:
您可以在 Red Hat OpenShift 網站 (英文) 上找到更多 Azure Red Hat OpenShift 範本範例。
將下列範例儲存為 azuredeploy.json:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location" : {
"type": "string",
"defaultValue": "eastus",
"metadata": {
"description": "Location"
}
},
"domain": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Domain Prefix"
}
},
"pullSecret": {
"type": "string",
"metadata": {
"description": "Pull secret from cloud.redhat.com. The json should be input as a string"
}
},
"clusterVnetName": {
"type": "string",
"defaultValue": "aro-vnet",
"metadata": {
"description": "Name of ARO vNet"
}
},
"clusterVnetCidr": {
"type": "string",
"defaultValue": "10.100.0.0/15",
"metadata": {
"description": "ARO vNet Address Space"
}
},
"workerSubnetCidr": {
"type": "string",
"defaultValue": "10.100.70.0/23",
"metadata": {
"description": "Worker node subnet address space"
}
},
"masterSubnetCidr": {
"type": "string",
"defaultValue": "10.100.76.0/24",
"metadata": {
"description": "Master node subnet address space"
}
},
"masterVmSize" : {
"type": "string",
"defaultValue": "Standard_D8s_v3",
"metadata": {
"description": "Master Node VM Type"
}
},
"workerVmSize": {
"type": "string",
"defaultValue": "Standard_D4s_v3",
"metadata": {
"description": "Worker Node VM Type"
}
},
"workerVmDiskSize": {
"type" : "int",
"defaultValue": 128,
"minValue": 128,
"metadata": {
"description": "Worker Node Disk Size in GB"
}
},
"workerCount": {
"type": "int",
"defaultValue": 3,
"minValue": 3,
"metadata": {
"description": "Number of Worker Nodes"
}
},
"podCidr": {
"type": "string",
"defaultValue": "10.128.0.0/14",
"metadata": {
"description": "Cidr for Pods"
}
},
"serviceCidr": {
"type": "string",
"defaultValue": "172.30.0.0/16",
"metadata": {
"description": "Cidr of service"
}
},
"clusterName" : {
"type": "string",
"metadata": {
"description": "Unique name for the cluster"
}
},
"tags": {
"type": "object",
"defaultValue" : {
"env": "Dev",
"dept": "Ops"
},
"metadata": {
"description": "Tags for resources"
}
},
"apiServerVisibility": {
"type": "string",
"allowedValues": [
"Private",
"Public"
],
"defaultValue": "Public",
"metadata": {
"description": "Api Server Visibility"
}
},
"ingressVisibility": {
"type": "string",
"allowedValues": [
"Private",
"Public"
],
"defaultValue": "Public",
"metadata": {
"description": "Ingress Visibility"
}
},
"aadClientId" : {
"type": "string",
"metadata": {
"description": "The Application ID of an Azure Active Directory client application"
}
},
"aadObjectId": {
"type": "string",
"metadata": {
"description": "The Object ID of an Azure Active Directory client application"
}
},
"aadClientSecret" : {
"type":"securestring",
"metadata": {
"description": "The secret of an Azure Active Directory client application"
}
},
"rpObjectId": {
"type": "String",
"metadata": {
"description": "The ObjectID of the Resource Provider Service Principal"
}
}
},
"variables": {
"contribRole": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]"
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-05-01",
"name": "[parameters('clusterVnetName')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('clusterVnetCidr')]"
]
},
"subnets": [
{
"name": "master",
"properties": {
"addressPrefix": "[parameters('masterSubnetCidr')]",
"serviceEndpoints": [
{
"service": "Microsoft.ContainerRegistry"
}
],
"privateLinkServiceNetworkPolicies": "Disabled"
}
},
{
"name": "worker",
"properties": {
"addressPrefix": "[parameters('workerSubnetCidr')]",
"serviceEndpoints": [
{
"service": "Microsoft.ContainerRegistry"
}
]
}
}]
}
},
{
"type": "Microsoft.Network/virtualNetworks/providers/roleAssignments",
"apiVersion": "2018-09-01-preview",
"name": "[concat(parameters('clusterVnetName'), '/Microsoft.Authorization/', guid(resourceGroup().id, deployment().name, parameters('aadObjectId')))]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('clusterVnetName'))]"
],
"properties": {
"roleDefinitionId": "[variables('contribRole')]",
"principalId":"[parameters('aadObjectId')]"
}
},
{
"type": "Microsoft.Network/virtualNetworks/providers/roleAssignments",
"apiVersion": "2018-09-01-preview",
"name": "[concat(parameters('clusterVnetName'), '/Microsoft.Authorization/', guid(resourceGroup().id, deployment().name, parameters('rpObjectId')))]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('clusterVnetName'))]"
],
"properties": {
"roleDefinitionId": "[variables('contribRole')]",
"principalId":"[parameters('rpObjectId')]"
}
},
{
"type": "Microsoft.RedHatOpenShift/OpenShiftClusters",
"apiVersion": "2020-04-30",
"name": "[parameters('clusterName')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('clusterVnetName'))]"
],
"properties": {
"clusterProfile": {
"domain": "[parameters('domain')]",
"resourceGroupId": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/aro-', parameters('domain'))]",
"pullSecret": "[parameters('pullSecret')]"
},
"networkProfile": {
"podCidr": "[parameters('podCidr')]",
"serviceCidr": "[parameters('serviceCidr')]"
},
"servicePrincipalProfile": {
"clientId": "[parameters('aadClientId')]",
"clientSecret": "[parameters('aadClientSecret')]"
},
"masterProfile": {
"vmSize": "[parameters('masterVmSize')]",
"subnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('clusterVnetName'), 'master')]"
},
"workerProfiles": [
{
"name": "worker",
"vmSize": "[parameters('workerVmSize')]",
"diskSizeGB": "[parameters('workerVmDiskSize')]",
"subnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('clusterVnetName'), 'worker')]",
"count": "[parameters('workerCount')]"
}
],
"apiserverProfile": {
"visibility": "[parameters('apiServerVisibility')]"
},
"ingressProfiles": [
{
"name": "default",
"visibility": "[parameters('ingressVisibility')]"
}
]
}
}
],
"outputs": {
"clusterCredentials": {
"type": "object",
"value": "[listCredentials(resourceId('Microsoft.RedHatOpenShift/OpenShiftClusters', parameters('clusterName')), '2020-04-30')]"
},
"oauthCallbackURL": {
"type": "string",
"value": "[concat('https://oauth-openshift.apps.', parameters('domain'), '.', parameters('location'), '.aroapp.io/oauth2callback/AAD')]"
}
}
}
下列範例展示在設定 Azure Red Hat OpenShift 叢集時,Azure Bicep 檔案完成的樣子。
Bicep 檔案會定義三項 Azure 資源:
您可以在 Red Hat OpenShift 網站 (英文) 上找到更多 Azure Red Hat OpenShift 範本。
建立下列 Bicep 檔案,其中包含 Azure Red Hat OpenShift 叢集的定義。 下列範例展示 Bicep 檔案設定完成的樣子。
將下列檔案儲存為 azuredeploy.bicep:
@description('Location')
param location string = 'eastus'
@description('Domain Prefix')
param domain string = ''
@description('Pull secret from cloud.redhat.com. The json should be input as a string')
param pullSecret string
@description('Name of ARO vNet')
param clusterVnetName string = 'aro-vnet'
@description('ARO vNet Address Space')
param clusterVnetCidr string = '10.100.0.0/15'
@description('Worker node subnet address space')
param workerSubnetCidr string = '10.100.70.0/23'
@description('Master node subnet address space')
param masterSubnetCidr string = '10.100.76.0/24'
@description('Master Node VM Type')
param masterVmSize string = 'Standard_D8s_v3'
@description('Worker Node VM Type')
param workerVmSize string = 'Standard_D4s_v3'
@description('Worker Node Disk Size in GB')
@minValue(128)
param workerVmDiskSize int = 128
@description('Number of Worker Nodes')
@minValue(3)
param workerCount int = 3
@description('Cidr for Pods')
param podCidr string = '10.128.0.0/14'
@metadata({
description: 'Cidr of service'
})
param serviceCidr string = '172.30.0.0/16'
@description('Unique name for the cluster')
param clusterName string
@description('Tags for resources')
param tags object = {
env: 'Dev'
dept: 'Ops'
}
@description('Api Server Visibility')
@allowed([
'Private'
'Public'
])
param apiServerVisibility string = 'Public'
@description('Ingress Visibility')
@allowed([
'Private'
'Public'
])
param ingressVisibility string = 'Public'
@description('The Application ID of an Azure Active Directory client application')
param aadClientId string
@description('The Object ID of an Azure Active Directory client application')
param aadObjectId string
@description('The secret of an Azure Active Directory client application')
@secure()
param aadClientSecret string
@description('The ObjectID of the Resource Provider Service Principal')
param rpObjectId string
@description('Specify if FIPS validated crypto modules are used')
@allowed([
'Enabled'
'Disabled'
])
param fips string = 'Disabled'
@description('Specify if master VMs are encrypted at host')
@allowed([
'Enabled'
'Disabled'
])
param masterEncryptionAtHost string = 'Disabled'
@description('Specify if worker VMs are encrypted at host')
@allowed([
'Enabled'
'Disabled'
])
param workerEncryptionAtHost string = 'Disabled'
var contributorRoleDefinitionId = resourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
var resourceGroupId = '/subscriptions/${subscription().subscriptionId}/resourceGroups/aro-${domain}-${location}'
var masterSubnetId=resourceId('Microsoft.Network/virtualNetworks/subnets', clusterVnetName, 'master')
var workerSubnetId=resourceId('Microsoft.Network/virtualNetworks/subnets', clusterVnetName, 'worker')
resource clusterVnetName_resource 'Microsoft.Network/virtualNetworks@2020-05-01' = {
name: clusterVnetName
location: location
tags: tags
properties: {
addressSpace: {
addressPrefixes: [
clusterVnetCidr
]
}
subnets: [
{
name: 'master'
properties: {
addressPrefix: masterSubnetCidr
serviceEndpoints: [
{
service: 'Microsoft.ContainerRegistry'
}
]
privateLinkServiceNetworkPolicies: 'Disabled'
}
}
{
name: 'worker'
properties: {
addressPrefix: workerSubnetCidr
serviceEndpoints: [
{
service: 'Microsoft.ContainerRegistry'
}
]
}
}
]
}
}
resource clusterVnetName_Microsoft_Authorization_id_name_aadObjectId 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = {
name: guid(aadObjectId, clusterVnetName_resource.id, contributorRoleDefinitionId)
scope: clusterVnetName_resource
properties: {
roleDefinitionId: contributorRoleDefinitionId
principalId: aadObjectId
principalType: 'ServicePrincipal'
}
}
resource clusterVnetName_Microsoft_Authorization_id_name_rpObjectId 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = {
name: guid(rpObjectId, clusterVnetName_resource.id, contributorRoleDefinitionId)
scope: clusterVnetName_resource
properties: {
roleDefinitionId: contributorRoleDefinitionId
principalId: rpObjectId
principalType: 'ServicePrincipal'
}
}
resource clusterName_resource 'Microsoft.RedHatOpenShift/OpenShiftClusters@2023-04-01' = {
name: clusterName
location: location
tags: tags
properties: {
clusterProfile: {
domain: domain
resourceGroupId: resourceGroupId
pullSecret: pullSecret
fipsValidatedModules: fips
}
networkProfile: {
podCidr: podCidr
serviceCidr: serviceCidr
}
servicePrincipalProfile: {
clientId: aadClientId
clientSecret: aadClientSecret
}
masterProfile: {
vmSize: masterVmSize
subnetId: masterSubnetId
encryptionAtHost: masterEncryptionAtHost
}
workerProfiles: [
{
name: 'worker'
vmSize: workerVmSize
diskSizeGB: workerVmDiskSize
subnetId: workerSubnetId
count: workerCount
encryptionAtHost: workerEncryptionAtHost
}
]
apiserverProfile: {
visibility: apiServerVisibility
}
ingressProfiles: [
{
name: 'default'
visibility: ingressVisibility
}
]
}
dependsOn: [
clusterVnetName_resource
]
}
azuredeploy.json 範本可用來部署 Azure Red Hat OpenShift 叢集。 必要參數如下:
注意
針對 domain
參數,指定網域前置詞以作為 OpenShift 主控台和 API 伺服器自動產生 DNS 名稱的一部分。 用於裝載叢集 VM 的資源群組也會在名稱加上此前置詞。
屬性 | 說明 | 有效選項 | 預設值 |
---|---|---|---|
domain |
叢集的網域前置詞。 | none | |
pullSecret |
您從 Red Hat OpenShift 叢集管理員網站取得的提取秘密。 | ||
clusterName |
叢集的名稱。 | ||
aadClientId |
Microsoft Entra 用戶端應用程式的應用程式識別碼 (GUID)。 | ||
aadObjectId |
Microsoft Entra 用戶端應用程式的服務主體物件識別碼 (GUID)。 | ||
aadClientSecret |
Microsoft Entra 用戶端應用程式的服務主體用戶端密碼,作為安全字串。 | ||
rpObjectId |
資源提供者服務主體的物件標識碼 (GUID)。 |
下列範本參數具有預設值。 您可以指定這些參數,但並非明確要求。
屬性 | 說明 | 有效選項 | 預設值 |
---|---|---|---|
location |
新 ARO 叢集的位置。 此位置可以與資源群組區域相同或不同。 | eastus | |
clusterVnetName |
ARO 叢集的虛擬網路名稱。 | aro-vnet | |
clusterVnetCidr |
ARO 虛擬網路的位址空間,以無類別域間路由 (CIDR) 標記法表示。 | 10.100.0.0/15 | |
workerSubnetCidr |
背景工作節點子網路的位址空間,以 CIDR 標記法表示。 | 10.100.70.0/23 | |
masterSubnetCidr |
控制平面節點子網路的位址空間,以 CIDR 標記法表示。 | 10.100.76.0/24 | |
masterVmSize |
控制平面節點的虛擬機器類型/大小。 | Standard_D8s_v3 | |
workerVmSize |
背景工作節點的虛擬機器類型/大小。 | Standard_D4s_v3 | |
workerVmDiskSize |
背景工作節點的磁碟大小,以 GB 為單位。 | 128 | |
workerCount |
背景工作節點數目。 | 3 | |
podCidr |
Pod 位址空間,以 CIDR 標記法表示。 | 10.128.0.0/14 | |
serviceCidr |
服務的位址空間,以 CIDR 標記法表示。 | 172.30.0.0/16 | |
tags |
資源標籤的雜湊表。 | @{env = 'Dev'; dept = 'Ops'} |
|
apiServerVisibility |
API 伺服器的可見度 (Public 或 Private )。 |
公開 | |
ingressVisibility |
輸入 (入口) 可見度 (Public 或 Private )。 |
公開 |
下列各節提供使用 PowerShell 或 Azure CLI 的指示。
如果您使用 PowerShell,請執行下列步驟。
在執行本文中的命令之前,您可能需要先執行 Connect-AzAccount
。 在繼續之前,請先檢查確認您是否能夠連線到 Azure。 若要檢查您是否具有連線能力,請執行 Get-AzContext
以確認您是否有權存取作用中的 Azure 訂用帳戶。
注意
此範本會使用從 Red Hat OpenShift 叢集管理員網站取得的提取秘密文字。 在繼續之前,請確定您已將提取秘密儲存為本機的 pull-secret.txt
。
$rhosPullSecret= Get-Content .\pull-secret.txt -Raw # the pull secret text that was obtained from the Red Hat OpenShift Cluster Manager website
$resourceGroup="aro-rg" # the new resource group for the cluster
$location="eastus" # the location of the new ARO cluster
$domain="mydomain" # the domain prefix for the cluster
$aroClusterName="cluster" # the name of the cluster
在您的訂用帳戶中註冊下列資源提供者:Microsoft.RedHatOpenShift
、Microsoft.Compute
、Microsoft.Storage
和 Microsoft.Authorization
。
Register-AzResourceProvider -ProviderNamespace Microsoft.RedHatOpenShift
Register-AzResourceProvider -ProviderNamespace Microsoft.Compute
Register-AzResourceProvider -ProviderNamespace Microsoft.Storage
Register-AzResourceProvider -ProviderNamespace Microsoft.Authorization
New-AzResourceGroup -Name $resourceGroup -Location $location
$suffix=Get-Random # random suffix for the Service Principal
$spDisplayName="sp-$resourceGroup-$suffix"
$azureADAppSp = New-AzADServicePrincipal -DisplayName $spDisplayName -Role Contributor
New-AzRoleAssignment -ObjectId $azureADAppSp.Id -RoleDefinitionName 'User Access Administrator' -ResourceGroupName $resourceGroup -ObjectType 'ServicePrincipal'
New-AzRoleAssignment -ObJectId $azureADAppSp.Id -RoleDefinitionName 'Contributor' -ResourceGroupName $resourceGroup -ObjectType 'ServicePrincipal'
$aadClientSecretDigest = ConvertTo-SecureString -String $azureADAppSp.PasswordCredentials.SecretText -AsPlainText -Force
$rpOpenShift = Get-AzADServicePrincipal -DisplayName 'Azure Red Hat OpenShift RP' | Select-Object -ExpandProperty Id -Property Id -First 1
# setup the parameters for the deployment
$templateParams = @{
domain = $domain
clusterName = $aroClusterName
location = $location
aadClientId = $azureADAppSp.AppId
aadObjectId = $azureADAppSp.Id
aadClientSecret = $aadClientSecretDigest
rpObjectId = $rpOpenShift.Id
pullSecret = $rhosPullSecret
}
Write-Verbose (ConvertTo-Json $templateParams) -Verbose
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroup @templateParams `
-TemplateFile azuredeploy.json
若要連線到新的叢集,請檢閱連線至 Azure Red Hat OpenShift 4 叢集中的步驟。
完成後,請執行下列命令來刪除資源群組,以及您在本文中建立的所有資源。
Remove-AzResourceGroup -Name $resourceGroup -Force
如果您使用 Azure CLI,請執行下列步驟。
在執行本文中的命令之前,您可能需要先執行 az login
。 在繼續之前,請先檢查您是否能夠連線到 Azure。 若要檢查您是否具有連線能力,請執行 az account list
,並確認您有權存取作用中的 Azure 訂用帳戶。
注意
此範本將會使用從 Red Hat OpenShift 叢集管理員網站取得的提取秘密文字。 在繼續之前,請確定您已將秘密儲存為本機的 pull-secret.txt
。
PULL_SECRET=$(cat pull-secret.txt) # the pull secret text
RESOURCEGROUP=aro-rg # the new resource group for the cluster
LOCATION=eastus # the location of the new cluster
DOMAIN=mydomain # the domain prefix for the cluster
ARO_CLUSTER_NAME=aro-cluster # the name of the cluster
在您的訂用帳戶中註冊下列資源提供者:Microsoft.RedHatOpenShift
、Microsoft.Compute
、Microsoft.Storage
和 Microsoft.Authorization
。
az provider register --namespace 'Microsoft.RedHatOpenShift' --wait
az provider register --namespace 'Microsoft.Compute' --wait
az provider register --namespace 'Microsoft.Storage' --wait
az provider register --namespace 'Microsoft.Authorization' --wait
az group create --name $RESOURCEGROUP --location $LOCATION
az ad sp create-for-rbac --name "sp-$RG_NAME-${RANDOM}" > app-service-principal.json
SP_CLIENT_ID=$(jq -r '.appId' app-service-principal.json)
SP_CLIENT_SECRET=$(jq -r '.password' app-service-principal.json)
SP_OBJECT_ID=$(az ad sp show --id $SP_CLIENT_ID | jq -r '.id')
az role assignment create \
--role 'User Access Administrator' \
--assignee-object-id $SP_OBJECT_ID \
--scope $SCOPE \
--assignee-principal-type 'ServicePrincipal'
az role assignment create \
--role 'Contributor' \
--assignee-object-id $SP_OBJECT_ID \
--scope $SCOPE \
--assignee-principal-type 'ServicePrincipal'
ARO_RP_SP_OBJECT_ID=$(az ad sp list --display-name "Azure Red Hat OpenShift RP" --query [0].id -o tsv)
az deployment group create \
--name aroDeployment \
--resource-group $RESOURCEGROUP \
--template-file azuredeploy.json \
--parameters location=$LOCATION \
--parameters domain=$DOMAIN \
--parameters pullSecret=$PULL_SECRET \
--parameters clusterName=$ARO_CLUSTER_NAME \
--parameters aadClientId=$SP_CLIENT_ID \
--parameters aadObjectId=$SP_OBJECT_ID \
--parameters aadClientSecret=$SP_CLIENT_SECRET \
--parameters rpObjectId=$ARO_RP_SP_OBJECT_ID
az deployment group create \
--name aroDeployment \
--resource-group $RESOURCEGROUP \
--template-file azuredeploy.bicep \
--parameters location=$LOCATION \
--parameters domain=$DOMAIN \
--parameters pullSecret=$PULL_SECRET \
--parameters clusterName=$ARO_CLUSTER_NAME \
--parameters aadClientId=$SP_CLIENT_ID \
--parameters aadObjectId=$SP_OBJECT_ID \
--parameters aadClientSecret=$SP_CLIENT_SECRET \
--parameters rpObjectId=$ARO_RP_SP_OBJECT_ID
若要連線到新的叢集,請檢閱連線至 Azure Red Hat OpenShift 4 叢集中的步驟。
完成後,請執行下列命令來刪除資源群組,以及您在本文中建立的所有資源。
az aro delete --resource-group $RESOURCEGROUP --name $CLUSTER
提示
有問題嗎? 在 GitHub 上的 Azure Red Hat Openshift (ARO) 存放庫 (英文) 中開啟問題以通知我們。
在本文中,您已了解如何使用 ARM 範本和 Bicep 建立執行 OpenShift 4 的 Azure Red Hat OpenShift 叢集。
進入下一篇文章,了解如何使用 Microsoft Entra ID 來設定叢集以進行驗證。
訓練
模組
使用 JSON ARM 範本部署 Azure 基礎結構 - Training
使用 Visual Studio Code 撰寫 JSON Azure Resource Manager 範本,一致又可靠地將基礎結構部署至 Azure。
文件
建立 Azure Red Hat OpenShift 4 叢集 - Azure Red Hat OpenShift
了解如何使用 Azure CLI 建立 Microsoft Azure Red Hat OpenShift 叢集
建立 Azure Red Hat OpenShift 4 私人叢集 - Azure Red Hat OpenShift
了解如何建立執行 OpenShift 4 的 Azure Red Hat OpenShift 私人叢集
部署大型 Azure Red Hat OpenShift 叢集 - Azure Red Hat OpenShift
探索如何部署大型 Azure Red Hat OpenShift 叢集。