你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

快速入门:使用 Azure 资源管理器模板或 Bicep 文件部署 Azure Red Hat OpenShift 群集

本快速入门介绍如何使用 Azure 资源管理器模板(ARM 模板)或 Bicep 创建 Azure Red Hat OpenShift 群集。 可以使用 PowerShell 或 Azure 命令行接口 (Azure CLI) 来部署 Azure Red Hat OpenShift 群集。

Azure 资源管理器模板是定义项目基础结构和配置的 JavaScript 对象表示法 (JSON) 文件。 模板使用声明性语法。 你可以在不编写用于创建部署的编程命令序列的情况下,描述预期部署。

Bicep 是一种特定于域的语言 (DSL),使用声明性语法来部署 Azure 资源。 在 Bicep 文件中,定义要部署到 Azure 的基础结构,然后在整个开发生命周期中使用该文件重复部署基础结构。 你的资源以一致的方式部署。

先决条件

创建 ARM 模板或 Bicep 文件

选择 Azure 资源管理器模板(ARM 模板)或 Azure Bicep 文件。 然后,可以使用 Azure 命令行 (azure-cli) 或 PowerShell 部署模板。

创建 ARM 模板

以下示例显示已针对 Azure RedHat OpenShift 群集进行了配置后的 ARM 模板的外观。

该模板定义了三个 Azure 资源:

Red Hat OpenShift 网站上可找到更多 Azure Red Hat OpenShift 模板示例。

将以下示例保存为 azuredeploy.bicep:

{
    "$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": {
              "decription": "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')]"
         }
    }
}

创建 Bicep 文件

以下示例显示已针对 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 模板

本部分提供有关部署 azuredeploy.json 模板的信息。

azuredeploy.json 参数

azuredeploy.json 模板用于部署 Azure Red Hat OpenShift 群集。 下列参数是必需的。

注意

对于 domain 参数,请指定将用作 OpenShift 控制台和 API 服务器的自动生成 DNS 名称的一部分的域前缀。 此前缀还会用作为托管群集 VM 而创建的资源组名称的一部分。

属性 描述 有效选项 默认值
domain 群集的域前缀。
pullSecret 从 Red Hat OpenShift 群集管理器网站获取的拉取机密。
clusterName 群集的名称。
aadClientId Microsoft Entra 客户端应用程序的应用程序 ID (GUID)。
aadObjectId Microsoft Entra 客户端应用程序服务主体的对象 ID (GUID)。
aadClientSecret Microsoft Entra 客户端应用程序服务主体的客户端密码,采用安全字符串形式。
rpObjectId 资源提供程序服务主体的对象 ID (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 服务器的可见性(PublicPrivate)。 公共
ingressVisibility 入口可见性(PublicPrivate)。 公共

以下部分提供有关使用 PowerShell 或 Azure CLI 的说明。

PowerShell 步骤

如果你使用 PowerShell,请执行以下步骤。

开始之前 - 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

将以下参数定义为环境变量 - PowerShell

$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

注册所需的资源提供程序 - PowerShell

在订阅中注册以下资源提供程序:Microsoft.RedHatOpenShiftMicrosoft.ComputeMicrosoft.StorageMicrosoft.Authorization

Register-AzResourceProvider -ProviderNamespace Microsoft.RedHatOpenShift
Register-AzResourceProvider -ProviderNamespace Microsoft.Compute
Register-AzResourceProvider -ProviderNamespace Microsoft.Storage
Register-AzResourceProvider -ProviderNamespace Microsoft.Authorization

创建新资源组 - PowerShell

New-AzResourceGroup -Name $resourceGroup -Location $location

创建新的服务主体并分配角色 - PowerShell

$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'

获取服务主体密码 - PowerShell

$aadClientSecretDigest = ConvertTo-SecureString -String $azureADAppSp.PasswordCredentials.SecretText -AsPlainText -Force

获取 OpenShift 资源提供程序的服务主体 - PowerShell

$rpOpenShift =  Get-AzADServicePrincipal -DisplayName 'Azure Red Hat OpenShift RP' | Select-Object -ExpandProperty Id -Property Id -First 1

在部署群集之前检查参数 - PowerShell

# 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

使用 ARM 模板部署 Azure Red Hat OpenShift 群集 - PowerShell

New-AzResourceGroupDeployment -ResourceGroupName $resourceGroup @templateParams `
    -TemplateFile azuredeploy.json

连接到群集

若要连接到新群集,请查看连接到 Azure Red Hat OpenShift 4 群集中的步骤。

清理资源 - PowerShell

完成后,运行以下命令删除你的资源组以及你在本教程中创建的所有资源。

Remove-AzResourceGroup -Name $resourceGroup -Force

Azure CLI 步骤

如果你使用 Azure CLI,请执行以下步骤。

开始之前 - 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 

将以下参数定义为环境变量 - Azure CLI

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

注册所需的资源提供程序 - Azure CLI

在订阅中注册以下资源提供程序:Microsoft.RedHatOpenShiftMicrosoft.ComputeMicrosoft.StorageMicrosoft.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

创建新资源组 - Azure CLI

az group create --name $RESOURCEGROUP --location $LOCATION

为新的 Microsoft Entra 应用程序创建服务主体

  • Azure CLI
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')

将“参与者”角色分配给新的服务主体 - Azure CLI

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'

获取 OpenShift 资源提供程序的服务主体对象 ID - Azure CLI

ARO_RP_SP_OBJECT_ID=$(az ad sp list --display-name "Azure Red Hat OpenShift RP" --query [0].id -o tsv)

部署群集 - Azure CLI

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 CLI

若要连接到新群集,请查看连接到 Azure Red Hat OpenShift 4 群集中的步骤。

清理资源 - Azure CLI

完成后,运行以下命令删除你的资源组以及你在本教程中创建的所有资源。

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 配置用于进行身份验证的群集。