Hızlı Başlangıç: Azure Resource Manager şablonu veya Bicep dosyasıyla Azure Red Hat OpenShift kümesi dağıtma
Bu makalede, Azure Red Hat OpenShift kümesi oluşturmak için Azure Resource Manager şablonunun (ARM şablonu) veya Bicep'in nasıl kullanılacağı açıklanmaktadır. Azure Red Hat OpenShift kümesini PowerShell veya Azure komut satırı arabirimi (Azure CLI) ile dağıtabilirsiniz.
Azure Resource Manager şablonu, projenizin altyapısını ve yapılandırmasını tanımlayan bir JavaScript Nesne Gösterimi (JSON) dosyasıdır. Bu şablonda, bildirim temelli sözdizimi kullanılır. Dağıtımı oluşturmak için programlama komutlarının sırasını yazmadan hedeflenen dağıtımınızı açıklarsınız.
Bicep, Azure kaynaklarını dağıtmak için bildirim temelli söz dizimi kullanan, etki alanına özgü bir dildir (DSL). Bir Bicep dosyasında, Azure'a dağıtmak istediğiniz altyapıyı tanımlarsınız ve sonra bu dosyayı geliştirme yaşam döngüsü boyunca kullanarak altyapınızı tekrar tekrar dağıtırsınız. Kaynaklarınız tutarlı bir şekilde dağıtılır.
Önkoşullar
Etkin aboneliği olan bir Azure hesabı gereklidir. Henüz bir hesabınız yoksa ücretsiz olarak bir hesap oluşturabilirsiniz.
Kullanıcı Erişimi Yöneticisi ve Katkıda Bulunan rolleri atama olanağı. Bu özellikten yoksunsanız rolleri yönetmek için Microsoft Entra yöneticinize başvurun.
Red Hat hesabı. Hesabınız yoksa bir hesaba kaydolmanız gerekir.
Azure Red Hat OpenShift kümeniz için çekme gizli dizisi. Red Hat OpenShift Cluster Manager web sitesinden çekme gizli dizisi dosyasını indirin.
Azure PowerShell kodunu yerel olarak çalıştırmak istiyorsanız, Azure PowerShell.
Azure CLI kodunu yerel olarak çalıştırmak istiyorsanız:
- Bash kabuğu (Windows için Git'te bulunan Git Bash gibi).
- Azure CLI.
ARM şablonu veya Bicep dosyası oluşturma
Azure Resource Manager şablonu (ARM şablonu) veya Azure Bicep dosyası seçin. Ardından, şablonu Azure komut satırını (azure-cli) veya PowerShell'i kullanarak dağıtabilirsiniz.
ARM şablonunu oluşturma
Aşağıdaki örnekte, Azure RedHat OpenShift kümeniz için yapılandırıldığında ARM şablonunuzun nasıl görünmesi gerektiği gösterilmektedir.
Şablon üç Azure kaynağı tanımlar:
- Microsoft.Network/virtualNetworks
- Microsoft.Network/virtualNetworks/providers/roleAssignments
- Microsoft.RedHatOpenShift/OpenShiftClusters
Red Hat OpenShift web sitesinde daha fazla Azure Red Hat OpenShift şablonu örneği bulunabilir.
Aşağıdaki örneği azuredeploy.bicep olarak kaydedin:
{
"$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 dosyası oluşturma
Aşağıdaki örnekte, Azure Red Hat OpenShift kümeniz için yapılandırıldığında Azure Bicep dosyanızın nasıl görünmesi gerektiği gösterilmektedir.
Bicep dosyası üç Azure kaynağı tanımlar:
- Microsoft.Network/virtualNetworks
- Microsoft.Network/virtualNetworks/providers/roleAssignments
- Microsoft.RedHatOpenShift/OpenShiftClusters
Red Hat OpenShift web sitesinde daha fazla Azure Red Hat OpenShift şablonu bulunabilir.
Azure Red Hat OpenShift kümesinin tanımını içeren aşağıdaki Bicep dosyasını oluşturun. Aşağıdaki örnekte, Yapılandırıldığında Bicep dosyanızın nasıl görünmesi gerektiği gösterilmektedir.
Aşağıdaki dosyayı azuredeploy.bicep olarak kaydedin:
@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 şablonunu dağıtma
azuredeploy.json şablonu bir Azure Red Hat OpenShift kümesi dağıtmak için kullanılır. Aşağıdaki parametreler gereklidir:
Not
parametresi için domain
, OpenShift konsolu ve API sunucuları için otomatik olarak oluşturulan DNS adının bir parçası olarak kullanılacak etki alanı ön ekini belirtin. Bu ön ek, küme VM'lerini barındırmak için oluşturulan kaynak grubunun adının bir parçası olarak da kullanılır.
Özellik | Açıklama | Geçerli Seçenekler | Varsayılan Değer |
---|---|---|---|
domain |
Küme için etki alanı ön eki. | yok | |
pullSecret |
Red Hat OpenShift Küme Yöneticisi web sitesinden aldığınız çekme gizli dizisi. | ||
clusterName |
Kümenin adı. | ||
aadClientId |
Microsoft Entra istemci uygulamasının uygulama kimliği (GUID). | ||
aadObjectId |
Microsoft Entra istemci uygulaması için hizmet sorumlusunun nesne kimliği (GUID). | ||
aadClientSecret |
Microsoft Entra istemci uygulaması için hizmet sorumlusunun gizli dizisi, güvenli bir dize olarak. | ||
rpObjectId |
Kaynak sağlayıcısı hizmet sorumlusunun nesne kimliği (GUID). |
Aşağıdaki şablon parametreleri varsayılan değerlere sahiptir. Bunlar belirtilebilir, ancak açıkça gerekli değildir.
Özellik | Açıklama | Geçerli Seçenekler | Varsayılan Değer |
---|---|---|---|
location |
Yeni ARO kümesinin konumu. Bu konum, kaynak grubu bölgesiyle aynı veya farklı olabilir. | eastus | |
clusterVnetName |
ARO kümesi için sanal ağın adı. | aro-vnet | |
clusterVnetCidr |
Sınıfsız Etki Alanları Arası Yönlendirme (CIDR) gösteriminde ARO sanal ağının adres alanı. | 10.100.0.0/15 | |
workerSubnetCidr |
CIDR gösteriminde çalışan düğümü alt ağdaki adres alanı. | 10.100.70.0/23 | |
masterSubnetCidr |
CIDR gösteriminde denetim düzlemi düğümü alt ağdaki adres alanı. | 10.100.76.0/24 | |
masterVmSize |
Denetim düzlemi düğümünün sanal makine türü/boyutu . | Standard_D8s_v3 | |
workerVmSize |
Çalışan düğümünün sanal makine türü/boyutu. | Standard_D4s_v3 | |
workerVmDiskSize |
Çalışan düğümünün gigabayt cinsinden disk boyutu. | 128 | |
workerCount |
Çalışan düğümlerinin sayısı. | 3 | |
podCidr |
CIDR gösteriminde podların adres alanı. | 10.128.0.0/14 | |
serviceCidr |
CIDR gösteriminde hizmetin adres alanı. | 172.30.0.0/16 | |
tags |
Kaynak etiketlerinin karma tablosu. | @{env = 'Dev'; dept = 'Ops'} |
|
apiServerVisibility |
API sunucusunun (Public veya Private ) görünürlüğü. |
Genel | |
ingressVisibility |
Giriş (giriş) görünürlüğü (Public veya Private ). |
Genel |
Aşağıdaki bölümlerde PowerShell veya Azure CLI kullanarak yönergeler sağlanır.
PowerShell adımları
PowerShell kullanıyorsanız aşağıdaki adımları gerçekleştirin.
Başlamadan önce - PowerShell
Bu makaledeki komutları çalıştırmadan önce komutunu çalıştırmanız Connect-AzAccount
gerekebilir. Devam etmeden önce Azure'a bağlantınız olup olmadığını denetleyin. Bağlantınız olup olmadığını denetlemek için komutunu çalıştırarak Get-AzContext
etkin bir Azure aboneliğine erişiminizin olup olmadığını doğrulayın.
Not
Bu şablon, Red Hat OpenShift Küme Yöneticisi web sitesinden alınan gizli dizi metnini kullanır. Devam etmeden önce, çekme gizli anahtarının olarak pull-secret.txt
yerel olarak kaydedildiğinden emin olun.
$rhosPullSecret= Get-Content .\pull-secret.txt -Raw # the pull secret text that was obtained from the Red Hat OpenShift Cluster Manager website
Aşağıdaki parametreleri ortam değişkenleri olarak tanımlayın - 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
Gerekli kaynak sağlayıcılarını kaydetme - PowerShell
Aboneliğinize şu kaynak sağlayıcılarını kaydedin: Microsoft.RedHatOpenShift
, Microsoft.Compute
ve Microsoft.Storage
Microsoft.Authorization
.
Register-AzResourceProvider -ProviderNamespace Microsoft.RedHatOpenShift
Register-AzResourceProvider -ProviderNamespace Microsoft.Compute
Register-AzResourceProvider -ProviderNamespace Microsoft.Storage
Register-AzResourceProvider -ProviderNamespace Microsoft.Authorization
Yeni kaynak grubunu oluşturma - PowerShell
New-AzResourceGroup -Name $resourceGroup -Location $location
Yeni hizmet sorumlusu oluşturma ve roller atama - 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'
Hizmet Sorumlusu parolasını alma - PowerShell
$aadClientSecretDigest = ConvertTo-SecureString -String $azureADAppSp.PasswordCredentials.SecretText -AsPlainText -Force
OpenShift kaynak sağlayıcısı için hizmet sorumlusunu alma - PowerShell
$rpOpenShift = Get-AzADServicePrincipal -DisplayName 'Azure Red Hat OpenShift RP' | Select-Object -ExpandProperty Id -Property Id -First 1
Kümeyi dağıtmadan önce parametreleri denetleyin - 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 şablonunu kullanarak Azure Red Hat OpenShift kümesini dağıtma - PowerShell
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroup @templateParams `
-TemplateFile azuredeploy.json
Kümenize bağlanma
Yeni kümenize bağlanmak için Azure Red Hat OpenShift 4 kümesine bağlanma'daki adımları gözden geçirin.
Kaynakları temizleme - PowerShell
İşiniz bittiğinde aşağıdaki komutu çalıştırarak kaynak grubunuzu ve bu makalede oluşturduğunuz tüm kaynakları silin.
Remove-AzResourceGroup -Name $resourceGroup -Force
Azure CLI adımları
Azure CLI kullanıyorsanız aşağıdaki adımları gerçekleştirin.
Başlamadan önce - Azure CLI
Bu makaledeki komutları çalıştırmadan önce çalıştırmanız az login
gerekebilir. Devam etmeden önce Azure'a bağlantınız olup olmadığını denetleyin. Bağlantınız olup olmadığını denetlemek için komutunu çalıştırın az account list
ve etkin bir Azure aboneliğine erişiminizin olduğunu doğrulayın.
Not
Bu şablon, Red Hat OpenShift Küme Yöneticisi web sitesinden alınan gizli dizi metnini kullanır. Devam etmeden önce bu gizli diziyi olarak yerel olarak pull-secret.txt
kaydettiğinizden emin olun.
PULL_SECRET=$(cat pull-secret.txt) # the pull secret text
Aşağıdaki parametreleri ortam değişkenleri olarak tanımlayın - 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
Gerekli kaynak sağlayıcılarını kaydetme - Azure CLI
Aboneliğinize şu kaynak sağlayıcılarını kaydedin: Microsoft.RedHatOpenShift
, Microsoft.Compute
ve 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
Yeni kaynak grubunu oluşturma - Azure CLI
az group create --name $RESOURCEGROUP --location $LOCATION
Yeni Microsoft Entra uygulaması için hizmet sorumlusu oluşturma
- 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')
Katkıda Bulunan rolünü yeni hizmet sorumlusuna atama - 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 kaynak sağlayıcısı için hizmet sorumlusu nesne kimliğini alma - Azure CLI
ARO_RP_SP_OBJECT_ID=$(az ad sp list --display-name "Azure Red Hat OpenShift RP" --query [0].id -o tsv)
Kümeyi dağıtma - 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
Kümenize bağlanma - Azure CLI
Yeni kümenize bağlanmak için Azure Red Hat OpenShift 4 kümesine bağlanma'daki adımları gözden geçirin.
Kaynakları temizleme - Azure CLI
İşiniz bittiğinde aşağıdaki komutu çalıştırarak kaynak grubunuzu ve bu makalede oluşturduğunuz tüm kaynakları silin.
az aro delete --resource-group $RESOURCEGROUP --name $CLUSTER
İpucu
Sorun mu yaşıyorsunuz? Azure Red Hat Openshift (ARO) deposunda bir sorun açarak GitHub'da bize bildirin.
Sonraki adımlar
Bu makalede, hem ARM şablonlarını hem de Bicep'i kullanarak OpenShift 4 çalıştıran bir Azure Red Hat OpenShift kümesi oluşturmayı öğrendiniz.
Microsoft Entra Id kullanarak kümeyi kimlik doğrulaması için yapılandırmayı öğrenmek için sonraki makaleye ilerleyin.
Azure Red Hat OpenShift (ARO) Kümeniz için hizmet sorumlusu kimlik bilgilerini döndürme
Komut satırını kullanarak Microsoft Entra Id ile kimlik doğrulamasını yapılandırma
Azure portalını ve OpenShift web konsolunukullanarak Microsoft Entra Id ile kimlik doğrulamasını yapılandırma i
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin