Aracılığıyla paylaş


Yönetilen kimliklerle Azure Red Hat OpenShift kümesi oluşturma (önizleme)

Bu makalede yönetilen kimlikleri kullanarak Azure Red Hat OpenShift kümesinin nasıl dağıtılacağı gösterilmektedir.

Önemli

Şu anda bu Azure Red Hat OpenShift özelliği yalnızca önizleme aşamasında sunulmaktadır. Önizleme özellikleri self servis ve kabul temelinde kullanılabilir. Önizlemeler olduğu gibi ve kullanılabildiği şekilde sağlanır ve hizmet düzeyi sözleşmelerinin ve sınırlı garantinin dışında tutulur. Azure Red Hat OpenShift önizlemeleri, müşteri desteği kapsamındadır. Bu nedenle, bu özellikler üretim kullanımı için tasarlanmamıştır.

Azure Red Hat OpenShift, yönetilen kimlikleri ve iş yükü kimliklerini destekleyen yönetilen bir OpenShift hizmetidir. Yönetilen kimlikler ve iş yükü kimlikleri, istemci gizli kimlik bilgileriyle hizmet sorumlusu gibi uzun ömürlü kimlik bilgileri yerine kısa süreli belirteçler sağlayarak iş yüklerinin ve uygulamaların güvenliğini sağlarken riski en aza indirmeye yardımcı olur.

Daha fazla bilgi için bakınız:

Önkoşullar

Azure CLI sürüm 2.67.0 veya üzerini kullandığınızdan emin olun. Yüklediğiniz Azure CLI sürümünü bulmak için kullanın az--version . Yüklemeniz veya yükseltmeniz gerekiyorsa bkz. Azure CLI'yı yükleme.

Azure Red Hat OpenShift, OpenShift kümesi oluşturmak için en az 44 çekirdek gerektirir. Yeni bir Azure aboneliği için varsayılan Azure kaynak kotası bu gereksinimi karşılamaz. Kaynak sınırınızda artış istemek için bkz . VM ailesi vCPU kotalarını artırma.

44 çekirdek aşağıdaki gibi kullanılır:

  • Bootstrap makinesi: 8 çekirdek
  • Kontrol düzlemi (ana makineler): 24 çekirdek
  • Hesaplama (işçi makineleri): 12 çekirdek

Yükleme tamamlandığında bootstrap makinesi kaldırılır ve kümeniz toplam 36 çekirdek kullanır. Daha fazla bilgi için bkz. Azure'a yükleme.

Örneğin, desteklenen sanal makine ailelerinden en küçüğünün "Standart DSv5" SKU'sunun mevcut abonelik kotasını kontrol etmek için:

LOCATION=eastus
az vm list-usage -l $LOCATION \
--query "[?contains(name.value, 'standardDSv5Family')]" -o table

Azure Red Hat OpenShift uzantı tekerleği dosyasını indirin (yalnızca önizleme)

Bu makaledeki komutları çalıştırmak için önce adresinden Azure Red Hat OpenShift uzantı tekerleği dosyasını https://aka.ms/az-aroext-latestindirin. Uzantıyı yüklemek için şu komutu çalıştırın:

az extension add -s <path to downloaded whl file>

İzinlerinizi doğrulama

Bu makalede, küme için sanal ağı ve yönetilen kimlikleri içeren bir kaynak grubu oluşturacaksınız. Kaynak grubu oluşturmak için, kaynak grubu veya onu içeren abonelikte Katkıda Bulunan ve Kullanıcı Erişimi Yöneticisi izinlerine veya Sahip izinlerine sahip olmanız gerekir.

Ayrıca, yönetilen kimlik kümesi oluşturmak ve kümenin kullanması için roller atamak için yeterli Microsoft Entra izinlerine (kiracının üye kullanıcısı veya Uygulama yöneticisi rolüyle atanmış bir konuk) ihtiyacınız vardır. Daha fazla bilgi için bkz. Üye ve konuklar ve Microsoft Entra Kimliğine sahip kullanıcılara yönetici ve yönetici olmayan roller atama.

Kaynak sağlayıcılarını kaydetme

Azure Red Hat OpenShift kaynak sağlayıcısı dahil olmak üzere bazı Azure kaynak sağlayıcılarının çalışması için kayıt gerekir. Kaynak sağlayıcısının kaydedilmesi, aboneliğinizin içinde kaynak sağlayıcısına kaynak oluşturma gibi belirli eylemleri gerçekleştirme yetkisi veren bir hizmet sorumlusu oluşturur. Kaynak sağlayıcısı kaydı hakkında daha fazla bilgi için bkz. Kaynak sağlayıcısını kaydetme.

  1. Birden çok Azure aboneliğiniz varsa ilgili abonelik kimliğini belirtin:

    az account set --subscription <SUBSCRIPTION ID>
    
  2. Kaynak sağlayıcısını Microsoft.RedHatOpenShift kaydedin:

    az provider register -n Microsoft.RedHatOpenShift --wait
    
  3. Kaynak sağlayıcısını Microsoft.Compute kaydedin:

    az provider register -n Microsoft.Compute --wait
    
  4. Kaynak sağlayıcısını Microsoft.Storage kaydedin:

    az provider register -n Microsoft.Storage --wait
    
  5. Kaynak sağlayıcısını Microsoft.Authorization kaydedin:

    az provider register -n Microsoft.Authorization --wait
    

Red Hat çekme gizli dizisi alma (isteğe bağlı)

Uyarı

Azure Red Hat OpenShift pull secret, Red Hat OpenShift lisansının maliyetini değiştirmez.

Red Hat çekme gizli dizisi, kümenizin OperatorHub'dan işleçler gibi diğer içeriklerle birlikte Red Hat kapsayıcı kayıt defterlerine erişmesini sağlar. Bu adım isteğe bağlıdır ancak önerilir. Çekme gizli dizisini daha sonra eklemeye karar verirseniz bu kılavuzu izleyin. Çekme gizli diziniz bu alanı cloud.openshift.com içerse bile bu alan gizli dizinizden kaldırılır. Bu alan, RedHat'e veri gönderen ve bu nedenle varsayılan olarak devre dışı bırakılan ek bir izleme özelliği sağlar. Bu özelliği etkinleştirmek için bkz . Uzaktan sistem durumu raporlamasını etkinleştirme.

  1. Red Hat OpenShift küme yöneticisi portalınıza gidin ve oturum açın.

    Red Hat hesabınızda oturum açmanız veya iş e-postanızla yeni bir Red Hat hesabı oluşturmanız ve hüküm ve koşulları kabul etmeniz gerekir.

  2. Çekme gizlisini indir seçeneğini seçin ve ardından Azure Red Hat OpenShift kümenizle kullanılacak bir çekme gizlisi indirin.

    Kaydedilen pull-secret.txt dosyayı güvenli bir yerde tutun. Red Hat veya sertifikalı iş ortakları için örnekler veya işleçler içeren bir küme oluşturmanız gerekiyorsa, dosya her küme oluşturma işleminde kullanılır.

    komutunu çalıştırırken parametresini az aro create kullanarak --pull-secret @pull-secret.txt çekme gizli dizinize başvurabilirsiniz. Dosyanızı az aro create depoladığınız dizinden yürütebilirsinizpull-secret.txt. Aksi takdirde değerini ile @pull-secret.txtdeğiştirin@/path/to/my/pull-secret.txt.

    Çekme gizli dizinizi kopyalayıp diğer betiklere başvuruyorsanız, çekme gizli diziniz geçerli bir JSON dizesi olarak biçimlendirilmelidir.

Kümeniz için özel etki alanı hazırlama (isteğe bağlı)

komutunu çalıştırırken parametresini az aro create kullanarak --domain foo.example.com kümeniz için özel bir etki alanı belirtebilirsiniz.

Uyarı

Azure CLI aracılığıyla küme oluştururken etki alanı adı isteğe bağlı olarak eklenebilir. Portal üzerinden küme eklerken bir etki alanı adı (veya OpenShift konsolu ve API sunucuları için otomatik olarak oluşturulan DNS adının parçası olarak kullanılan bir ön ek) gerekir. Daha fazla bilgi için bkz . Hızlı Başlangıç: Azure portalını kullanarak Azure Red Hat OpenShift kümesi dağıtma.

Kümeniz için özel bir etki alanı sağlarsanız aşağıdaki noktaları not edin:

  • Kümenizi oluşturduktan sonra, belirtilenler için --domain DNS sunucunuzda iki DNS A kaydı oluşturmanız gerekir:
    • api - API sunucusu IP adresine işaret etme
    • *.apps - giriş IP adresine işaret eder
    • Küme oluşturulduktan sonra aşağıdaki komutu yürüterek bu değerleri alın: az aro show -n -g --query '{api:apiserverProfile.ip, ingress:ingressProfiles[0].ip}'.
  • OpenShift konsolu, yerleşik etki alanı https://console-openshift-console.apps.example.comyerine gibi https://console-openshift-console.apps.<random>.<location>.aroapp.iobir URL'de kullanılabilir.
  • Varsayılan olarak, OpenShift özel etki alanlarında *.apps.example.comoluşturulan tüm yollar için otomatik olarak imzalanan sertifikalar kullanır. Kümeye bağlandıktan sonra özel DNS kullanmayı seçerseniz, giriş denetleyiciniz için özel bir CA ve API sunucunuz için özel ca yapılandırmak için OpenShift belgelerini izlemeniz gerekir.

Kurulum

Yönetilen kimlikleri kullanarak Bir Azure Red Hat OpenShift kümesi dağıtmak için Azure CLI veya Bicep kullanabilirsiniz.

Azure CLI kullanarak yükleme

Bu bölümde, yönetilen kimlikleri kullanarak Azure Red Hat OpenShift kümesi oluşturmak için Azure CLI'nin nasıl kullanılacağı açıklanmaktadır.

İki boş alt ağ içeren bir sanal ağ oluşturma

İki boş alt ağ içeren bir sanal ağ oluşturun. Gereksinimlerinizi karşılayan bir sanal ağınız varsa bu adımı atlayın.

Ağ ve gereksinimler hakkında bilgi için bkz. Azure Red Hat OpenShift için ağ oluşturma.

  1. Komutlarını yürüttüğüniz az kabuk ortamında aşağıdaki değişkenleri ayarlayın.

    LOCATION=eastus                 # the location of your cluster
    RESOURCEGROUP=aro-rg            # the name of the resource group where you want to create your cluster
    CLUSTER=cluster                 # the name of your cluster
    
  2. Bir kaynak grubu oluşturun.

    Azure kaynak grubu, Azure kaynaklarının dağıtıldığı ve yönetildiği mantıksal bir gruptur. Bir kaynak grubu oluşturduğunuzda, bir konum belirtmeniz istenir. Kaynak oluşturma sırasında başka bir bölge belirtmezseniz kaynak grubu meta verilerinin depolandığı ve kaynaklarınızın Azure'da çalıştırıldığı konumdur. az group create komutunu kullanarak bir kaynak grubu oluşturun .

    Uyarı

    Azure Red Hat OpenShift, azure kaynak grubunun oluşturulabileceği tüm bölgelerde kullanılamaz. Azure Red Hat OpenShift'in nerede desteklendiği hakkında bilgi için bkz . Kullanılabilir bölgeler .

    az group create \
      --location $LOCATION \
      --name $RESOURCEGROUP
    
  3. Daha önce oluşturulan aynı kaynak grubunda bir sanal ağ, ana ağ ve çalışan alt ağları oluşturun.

    Azure Red Hat OpenShift kümeleri, ana ve çalışan düğümleri için iki boş alt ağa sahip bir sanal ağ gerektirir. Yeni bir sanal ağ oluşturabilir veya mevcut bir sanal ağı kullanabilirsiniz.

    az network vnet create \
       --resource-group $RESOURCEGROUP \
       --name aro-vnet \
       --address-prefixes 10.0.0.0/22
    
    az network vnet subnet create \
       --resource-group $RESOURCEGROUP \
       --vnet-name aro-vnet \
       --name master \
       --address-prefixes 10.0.0.0/23
    
    az network vnet subnet create \
       --resource-group $RESOURCEGROUP \
       --vnet-name aro-vnet \
       --name worker \
       --address-prefixes 10.0.2.0/23
    

Gerekli kullanıcı tarafından atanan yönetilen kimlikleri oluşturun

  1. Aşağıdaki gerekli kimlikleri oluşturun. Azure Red Hat OpenShift için dokuz yönetilen kimlik gerekir ve her birinin atanmış, yerleşik bir rolü olması gerekir:

    • Temel OpenShift işleçleri ile ilgili yedi yönetilen kimlik.
    • Azure Red Hat OpenShift hizmet operatörü için bir yönetilen kimlik.
    • Bu kimliklerin kullanımını etkinleştirmek için küme için bir kimlik daha.

    Yönetilen kimlik bileşenleri şunlardır:

    • OpenShift Görüntü Kayıt Defteri İşleci (image-registry)
    • OpenShift Ağ Operatörü (cloud-network-config)
    • OpenShift Disk Depolama Operatörü (disk-csi-sürücü)
    • OpenShift Dosya Depolama İşleci (file-csi-driver)
    • OpenShift Kümesi Giriş Operatörü (ingress)
    • OpenShift Bulut Denetleyici Yöneticisi (cloud-controller-manager)
    • OpenShift Makine API Operatörü (machine-api)
    • Azure Red Hat OpenShift Hizmet Operatörü (aro-operator)

    Azure Red Hat OpenShift'in her bileşeninin görevlerini yerine getirmesi için gereken izinleri temsil eden sekiz farklı yönetilen kimlik ve buna karşılık gelen yerleşik roller vardır. Buna ek olarak, platform, daha önce listelenen yönetilen kimlik bileşenleri (aro-cluster) için federasyon kimlik bilgisi oluşturma işlemini gerçekleştirmek için küme kimliği olmak üzere başka bir kimlik gerektirir.

    Red Hat OpenShift küme işleçleri hakkında daha fazla bilgi için bkz. Küme İşleçleri başvurusu.

    Azure Red Hat OpenShift'teki yönetilen kimlikler hakkında daha fazla bilgi için bkz. Azure Red Hat OpenShift'te yönetilen kimlikleri anlama.

    Gerekli kimlikleri oluşturun:

    az identity create \
    --resource-group $RESOURCEGROUP \
    --name aro-cluster
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name cloud-controller-manager
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name ingress
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name machine-api
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name disk-csi-driver
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name cloud-network-config
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name image-registry
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name file-csi-driver
    
    az identity create \
    --resource-group $RESOURCEGROUP \
    --name aro-operator
    
  2. Her operatör kimliği, küme kimliği ve birinci taraf hizmet ilkesi için gerekli rol atamalarını oluşturun.

    Uyarı

    Bu makalede yalnızca ana ve çalışan alt ağlarının mevcut olduğu varsayılır. Yükleme zamanında daha fazla küme alt ağı yapılandırdıysanız, bunu gerektiren işleçler için bu alt ağlara rol atama kapsamı vermeniz gerekir.

    Ana ve çalışan alt ağlar için aşağıdaki rol atamaları, bir ağ güvenlik grubu (NSG), yönlendirme tablosu veya ağ adresi çevirisi (NAT) ağ geçidinin eklenmediğini varsayar. Bu ağ kaynaklarından herhangi birini yüklemeye getirirseniz, bu ek ağ kaynakları için operatör kimliklerine izin veren daha fazla rol ataması oluşturmanız gerekir. Aşağıdaki alt ağlar veya sanal ağ için rol ataması gerektiren her operatör için ek ağ kaynağı için bir rol ataması da gerekir.

    SUBSCRIPTION_ID=$(az account show --query 'id' -o tsv)
    
    # assign cluster identity permissions over identities previously created
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-operator"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cloud-controller-manager"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ingress"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/machine-api"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/disk-csi-driver"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cloud-network-config"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/image-registry"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-cluster --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/ef318e2a-8334-4a05-9e4a-295a196c6a6e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/file-csi-driver"
    
    # assign vnet-level permissions for operators that require it, and subnets-level permission for operators that require it
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name cloud-controller-manager --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/a1f96423-95ce-4224-ab27-4e3dc72facd4" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/master"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name cloud-controller-manager --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/a1f96423-95ce-4224-ab27-4e3dc72facd4" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/worker"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name ingress --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/0336e1d3-7a87-462b-b6db-342b63f7802c" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/master"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name ingress --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/0336e1d3-7a87-462b-b6db-342b63f7802c" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/worker"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name machine-api --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/0358943c-7e01-48ba-8889-02cc51d78637" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/master"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name machine-api --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/0358943c-7e01-48ba-8889-02cc51d78637" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/worker"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name cloud-network-config --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/be7a6435-15ae-4171-8f30-4a343eff9e8f" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name file-csi-driver --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/0d7aedc0-15fd-4a67-a412-efad370c947e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/master"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name file-csi-driver --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/0d7aedc0-15fd-4a67-a412-efad370c947e" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/worker"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-operator --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/4436bae4-7702-4c84-919b-c4069ff25ee2" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/master"
    
    az role assignment create \
        --assignee-object-id "$(az identity show --resource-group $RESOURCEGROUP --name aro-operator --query principalId -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/4436bae4-7702-4c84-919b-c4069ff25ee2" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet/subnets/worker"
    
    az role assignment create \
        --assignee-object-id "$(az ad sp list --display-name "Azure Red Hat OpenShift RP" --query '[0].id' -o tsv)" \
        --assignee-principal-type ServicePrincipal \
        --role "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Authorization/roleDefinitions/4d97b98b-1d4f-4787-a291-c67834d212e7" \
        --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/aro-vnet"
    

Kümeyi oluşturma

Küme oluşturmak için seçenekler altında gösterilen aşağıdaki komutu çalıştırın. Aşağıdaki seçeneklerden birini kullanmayı seçerseniz, komutu uygun şekilde değiştirin:

  • Seçenek 1: Kümenizin Red Hat kapsayıcı kayıt defterlerine ve başka içeriklere erişmesini sağlayan Red Hat çekme gizli anahtarınızı geçirebilirsiniz. --pull-secret @pull-secret.txt Bağımsız değişkeni komutunuza ekleyin.
  • 2. Seçenek: Özel bir alan adı kullanabilirsiniz. bağımsız değişkenini --domain foo.example.com kendi özel etki alanınızla değiştirerek foo.example.com komutunuza ekleyin.

Kümeyi gerekli ortam değişkenleriyle oluşturun. Her --assign-platform-workload-identity bayrak için ilk bağımsız değişken, Azure Red Hat OpenShift kaynak sağlayıcısına belirli bir kimlik için hangi OpenShift işlecinin kullanılacağını bildiren anahtarı temsil eder. İkinci bağımsız değişken, kimliğe olan bağlantıyı temsil eder.

az aro create \
    --resource-group $RESOURCEGROUP \
    --name $CLUSTER \
    --vnet aro-vnet \
    --master-subnet master \
    --worker-subnet worker \
    --version <VERSION> \
    --enable-managed-identity \
    --assign-cluster-identity aro-cluster \
    --assign-platform-workload-identity file-csi-driver file-csi-driver \
    --assign-platform-workload-identity cloud-controller-manager cloud-controller-manager \
    --assign-platform-workload-identity ingress ingress \
    --assign-platform-workload-identity image-registry image-registry \
    --assign-platform-workload-identity machine-api machine-api \
    --assign-platform-workload-identity cloud-network-config cloud-network-config \
    --assign-platform-workload-identity aro-operator aro-operator \
    --assign-platform-workload-identity disk-csi-driver disk-csi-driver

Seçenek olarak, kimlik kaynakları farklı bir bölgede veya kaynak grubunda bulunuyorsa, oluşturmak için tam kaynak kimliklerini iletebilirsiniz. Aşağıdaki örneğe bakın:

az aro create \
    --resource-group $RESOURCEGROUP \
    --name $CLUSTER \
    --vnet aro-vnet \
    --master-subnet master \
    --worker-subnet worker \
    --version <VERSION> \
    --enable-managed-identity \
    --assign-cluster-identity /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-cluster \
    --assign-platform-workload-identity file-csi-driver /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/file-csi-driver \
    --assign-platform-workload-identity cloud-controller-manager /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cloud-controller-manager \
    --assign-platform-workload-identity ingress /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ingress \
    --assign-platform-workload-identity image-registry /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/image-registry \
    --assign-platform-workload-identity machine-api /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/machine-api \
    --assign-platform-workload-identity cloud-network-config /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cloud-network-config \
    --assign-platform-workload-identity aro-operator /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-operator \
    --assign-platform-workload-identity disk-csi-driver /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/disk-csi-driver

Farklı bir Azure Red Hat OpenShift sürümü seçin

Kümenizi oluştururken Azure Red Hat OpenShift'in belirli bir sürümünü kullanmayı seçebilirsiniz. İlk olarak, kullanılabilir Azure Red Hat OpenShift sürümlerini sorgulamak için CLI'yi kullanın:

az aro get-versions --location <REGION>

Sürüm seçildikten sonra --version parametresini az aro create komutunda belirtin.

Bicep ile yükleme

Bu bölümde, yönetilen kimlikleri kullanarak Azure Red Hat OpenShift kümesi oluşturmak için Bicep'in nasıl kullanılacağı açıklanmaktadır.

  1. Örnek Bicep şablonunu (5. adımdan sonra bulunur) bir dosyaya kaydedin.

  2. Komutları yürütmeyi az planladığınız kabuk ortamında aşağıdaki değişkenleri ayarlayın.

    LOCATION=eastus                     # the location of your cluster
    RESOURCEGROUP=aro-rg                # the name of the resource group where you want to create your cluster
    CLUSTER=cluster                     # the name of your cluster
    VERSION=4.15.35                     # the version of the cluster
    PULL_SECRET=$(cat pull-secret.txt)  # the Red Hat pull secret JSON, provided as file or string
    
  3. Küme kaynağını, küme sanal ağını ve kimliklerini tutmak için bir kaynak grubu oluşturun.

    az group create --name $RESOURCEGROUP --location $LOCATION
    
  4. Kaynak sağlayıcısı için aboneliğinizin birinci taraf hizmet sorumlusu nesne kimliğini denetleyin.

    ARO_RP_SP_OBJECT_ID=$(az ad sp list --display-name "Azure Red Hat OpenShift RP" --query '[0].id' -o tsv)
    
  5. Bicep şablonunu uygulama:

    az deployment group create \
        --name aroDeployment \
        --resource-group $RESOURCEGROUP \
        --template-file azuredeploy.bicep \
        --parameters location=$LOCATION \
        --parameters version=$VERSION \
        --parameters clusterName=$CLUSTER \
        --parameters rpObjectId=$ARO_RP_SP_OBJECT_ID
        (--parameters domain=$DOMAIN) \ #optional
        (--parameters pullSecret=$PULL_SECRET) # optional
    

Örnek Bicep Şablonu

Uyarı

Bu makalede yalnızca ana ve çalışan alt ağlarının mevcut olduğu varsayılır. Yükleme zamanında daha fazla küme alt ağı yapılandırdıysanız, bunu gerektiren işleçler için bu alt ağlara rol atama kapsamı vermeniz gerekir.

Ana ve çalışan alt ağlar için aşağıdaki rol atamaları, bir ağ güvenlik grubu (NSG), yönlendirme tablosu veya ağ adresi çevirisi (NAT) ağ geçidinin eklenmediğini varsayar. Bu ağ kaynaklarından herhangi birini yüklemeye getirirseniz, bu ek ağ kaynakları için operatör kimliklerine izin veren daha fazla rol ataması oluşturmanız gerekir. Aşağıdaki alt ağlar veya sanal ağ için rol ataması gerektiren her operatör için ek ağ kaynağı için bir rol ataması da gerekir.

@description('Location')
param location string = resourceGroup().location

@description('Domain Prefix')
param domain string

@description('Version of the OpenShift cluster')
param version string

@description('Pull secret from cloud.redhat.com. The json should be input as a string')
@secure()
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('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('Api Server Visibility')
@allowed([
 'Private'
 'Public'
])
param apiServerVisibility string = 'Public'

@description('Ingress Visibility')
@allowed([
 'Private'
 'Public'
])
param ingressVisibility string = 'Public'

@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 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 vnet 'Microsoft.Network/virtualNetworks@2023-06-01' = {
 name: clusterVnetName
 location: location
 properties: {
   addressSpace: { addressPrefixes: [ clusterVnetCidr ] }
   subnets: [
     {
       name: 'master'
       properties: {
         addressPrefixes: [ masterSubnetCidr ]
         serviceEndpoints: [ { service: 'Microsoft.ContainerRegistry' } ]
       }
     }
     {
       name: 'worker'
       properties: {
         addressPrefixes: [ workerSubnetCidr ]
         serviceEndpoints: [ { service: 'Microsoft.ContainerRegistry' } ]
       }
     }
   ]
 }
}

resource workerSubnet 'Microsoft.Network/virtualNetworks/subnets@2020-08-01' existing = {
 parent: vnet
 name: 'worker'
}

resource masterSubnet 'Microsoft.Network/virtualNetworks/subnets@2020-08-01' existing = {
 parent: vnet
 name: 'master'
}

// create required identities

resource cloudControllerManager 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'cloud-controller-manager'
   location: location
}

resource ingress 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'ingress'
   location: location
}

resource machineApi 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'machine-api'
   location: location
}

resource diskCsiDriver 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'disk-csi-driver'
   location: location
}

resource cloudNetworkConfig 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'cloud-network-config'
   location: location
}

resource imageRegistry 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'image-registry'
   location: location
}

resource fileCsiDriver 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'file-csi-driver'
   location: location
}

resource aroOperator 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'aro-operator'
   location: location
}

resource clusterMsi 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
   name: 'cluster'
   location: location
}

// create required role assignments on vnet / subnets

resource cloudControllerManagerMasterSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(masterSubnet.id, 'cloud-controller-manager')
   scope: masterSubnet
   properties: {
       principalId: cloudControllerManager.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a1f96423-95ce-4224-ab27-4e3dc72facd4')
       principalType: 'ServicePrincipal'
   }
}

resource cloudControllerManagerWorkerSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
 name: guid(workerSubnet.id, 'cloud-controller-manager')
 scope: workerSubnet
 properties: {
     principalId: cloudControllerManager.properties.principalId
     roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a1f96423-95ce-4224-ab27-4e3dc72facd4')
     principalType: 'ServicePrincipal'
 }
}

resource ingressMasterSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(masterSubnet.id, 'ingress')
   scope: masterSubnet
   properties: {
       principalId: ingress.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0336e1d3-7a87-462b-b6db-342b63f7802c')
       principalType: 'ServicePrincipal'
   }
}

resource ingressWorkerSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
 name: guid(workerSubnet.id, 'ingress')
 scope: workerSubnet
 properties: {
     principalId: ingress.properties.principalId
     roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0336e1d3-7a87-462b-b6db-342b63f7802c')
     principalType: 'ServicePrincipal'
 }
}

resource machineApiMasterSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(masterSubnet.id, 'machine-api')
   scope: masterSubnet
   properties: {
       principalId: machineApi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0358943c-7e01-48ba-8889-02cc51d78637')
       principalType: 'ServicePrincipal'
   }
}

resource machineApiWorkerSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(workerSubnet.id, 'machine-api')
   scope: workerSubnet
   properties: {
       principalId: machineApi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0358943c-7e01-48ba-8889-02cc51d78637')
       principalType: 'ServicePrincipal'
   }
}

resource cloudNetworkConfigVnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(vnet.id, 'cloud-network-config')
   scope: vnet
   properties: {
       principalId: cloudNetworkConfig.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'be7a6435-15ae-4171-8f30-4a343eff9e8f')
       principalType: 'ServicePrincipal'
   }
}

resource fileCsiDriverMasterSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(masterSubnet.id, 'file-csi-driver')
   scope: masterSubnet
   properties: {
       principalId: fileCsiDriver.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0d7aedc0-15fd-4a67-a412-efad370c947e')
       principalType: 'ServicePrincipal'
   }
}

resource fileCsiDriverWorkerSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
 name: guid(workerSubnet.id, 'file-csi-driver')
 scope: workerSubnet
 properties: {
     principalId: fileCsiDriver.properties.principalId
     roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0d7aedc0-15fd-4a67-a412-efad370c947e')
     principalType: 'ServicePrincipal'
 }
}

resource aroOperatorMasterSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(masterSubnet.id, 'aro-operator')
   scope: masterSubnet
   properties: {
       principalId: aroOperator.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4436bae4-7702-4c84-919b-c4069ff25ee2')
       principalType: 'ServicePrincipal'
   }
}

resource aroOperatorWorkerSubnetRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
 name: guid(workerSubnet.id, 'aro-operator')
 scope: workerSubnet
 properties: {
     principalId: aroOperator.properties.principalId
     roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4436bae4-7702-4c84-919b-c4069ff25ee2')
     principalType: 'ServicePrincipal'
 }
}

// create required role assignments on cluster MSI

resource clusterMsiRoleAssignmentCloudControllerManager 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(cloudControllerManager.id, 'cluster')
   scope: cloudControllerManager
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

resource clusterMsiRoleAssignmentIngress 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(ingress.id, 'cluster')
   scope: ingress
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

resource clusterMsiRoleAssignmentMachineApi 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(machineApi.id, 'cluster')
   scope: machineApi
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

resource clusterMsiRoleAssignmentDiskCsiDriver 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(diskCsiDriver.id, 'cluster')
   scope: diskCsiDriver
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

resource clusterMsiRoleAssignmentCloudNetworkConfig 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(cloudNetworkConfig.id, 'cluster')
   scope: cloudNetworkConfig
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

resource clusterMsiRoleAssignmentCloudImageRegistry 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(imageRegistry.id, 'cluster')
   scope: imageRegistry
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

resource clusterMsiRoleAssignmentCloudFileCsiDriver 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(fileCsiDriver.id, 'cluster')
   scope: fileCsiDriver
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

resource clusterMsiRoleAssignmentCloudAroOperator 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(aroOperator.id, 'cluster')
   scope: aroOperator
   properties: {
       principalId: clusterMsi.properties.principalId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ef318e2a-8334-4a05-9e4a-295a196c6a6e')
       principalType: 'ServicePrincipal'
   }
}

// create first party role assignment over the vnet

resource fpspRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
   name: guid(vnet.id, rpObjectId)
   scope: vnet
   properties: {
       principalId: rpObjectId
       roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4d97b98b-1d4f-4787-a291-c67834d212e7')
       principalType: 'ServicePrincipal'
   }
}

// create cluster

resource cluster 'Microsoft.RedHatOpenShift/openShiftClusters@2024-08-12-preview' = {
   name: clusterName
   location: location
   properties: {
       clusterProfile: {
           domain: domain
           #disable-next-line use-resource-id-functions
           resourceGroupId: resourceGroupId
           version: version
           fipsValidatedModules: fips
           pullSecret: pullSecret
       }
       networkProfile: {podCidr: podCidr, serviceCidr: serviceCidr}
       masterProfile: {
           vmSize: masterVmSize
           subnetId: masterSubnetId
           encryptionAtHost: masterEncryptionAtHost
       }
       workerProfiles: [{
           name: 'worker'
           count: 3
           diskSizeGB: workerVmDiskSize
           vmSize: workerVmSize
           subnetId: workerSubnetId
           encryptionAtHost: workerEncryptionAtHost
       }]
       apiserverProfile: {visibility: apiServerVisibility}
       ingressProfiles: [{name: 'default', visibility: ingressVisibility}]
       platformWorkloadIdentityProfile: {
           platformWorkloadIdentities: {
               'cloud-controller-manager': {resourceId: cloudControllerManager.id}
               ingress: {resourceId: ingress.id}
               'machine-api': {resourceId: machineApi.id}
               'disk-csi-driver': {resourceId: diskCsiDriver.id}
               'cloud-network-config': {resourceId: cloudNetworkConfig.id}
               'image-registry': {resourceId: imageRegistry.id}
               'file-csi-driver': {resourceId: fileCsiDriver.id}
               'aro-operator': {resourceId: aroOperator.id}
           }
       }
   }
   identity: {
       type: 'UserAssigned'
       userAssignedIdentities: {
           '${clusterMsi.id}': {}
       }
   }
}

Temizleme

Yönetilen kimlik kümesini silmek için aşağıdaki komutu çalıştırın:

az aro delete -n $CLUSTER -g $RESOURCEGROUP

Bu silme komutunun yüklemenin bir parçası olarak oluşturulan küme tarafından atanan yönetilen kimlikleri temizlemediğini unutmayın. Kimlikleri ve rol atamalarını el ile silmeniz gerekir.