2.5. Azure リソースにアクセスするためにサポートされている ID
OpenShift Container Platform クラスターでは、Azure リソースを作成および管理するために Azure ID が必要です。したがって、インストールを完了するには、次のいずれかのタイプの ID が必要です。
- サービスプリンシパル
- システムが割り当てたマネージド ID
- ユーザーが割り当てたマネージド ID
2.5.1. 必要な Azure ロール
OpenShift Container Platform クラスターでは、Azure リソースを作成および管理するために Azure ID が必要です。ID を作成する前に、環境が次の要件を満たしていることを確認してください。
ID の作成に使用する Azure アカウントには、
User Access Administrator
ロールとContributor
ロールが割り当てられます。これらのロールは次の場合に必要です。- サービスプリンシパルまたはユーザー割り当てのマネージド ID を作成します。
- 仮想マシン上でシステム割り当てマネージド ID を有効にします。
-
サービスプリンシパルを使用してインストールを完了する場合は、ID の作成に使用する Azure アカウントに、Microsoft Entra ID の
Microsoft.directory/servicePrincipals/createAsOwner
パーミッションが割り当てられていることを確認してください。
Azure ポータルでロールを設定するには、Azure ドキュメントの Manage access to Azure resources using RBAC and the Azure portal を参照します。
2.5.2. installer-provisioned infrastructure に必要な Azure アクセス許可
インストールプログラムでは、クラスターをデプロイし、日常の操作を維持するために必要なパーミッションを持つ Azure サービスプリンシパルまたはマネージド ID にアクセスする必要があります。これらパーミッションは、ID に関連付けられた Azure サブスクリプションに付与する必要があります。
以下のオプションを使用できます。
ID に
Contributor
ロールとUser Access Administrator
ロールを割り当てることができます。これらのロールを割り当てるのが、必要な権限をすべて付与する最も簡単な方法です。ロールの割り当ての詳細は、Azure portal を使用した Azure リソースへのアクセスの管理 に関する Azure ドキュメントを参照してください。
- 組織のセキュリティーポリシーにより、さらに制限された権限セットが要求される場合は、必要な権限を持つ カスタムロール を作成できます。
Microsoft Azure で OpenShift Container Platform クラスターを作成するには、以下のアクセス許可が必要です。
例2.1 承認リソースを作成するために必要な権限
-
Microsoft.Authorization/policies/audit/action
-
Microsoft.Authorization/policies/auditIfNotExists/action
-
Microsoft.Authorization/roleAssignments/read
-
Microsoft.Authorization/roleAssignments/write
例2.2 コンピューティングリソースの作成に必要な権限
-
Microsoft.Compute/availabilitySets/read
-
Microsoft.Compute/availabilitySets/write
-
Microsoft.Compute/disks/beginGetAccess/action
-
Microsoft.Compute/disks/delete
-
Microsoft.Compute/disks/read
-
Microsoft.Compute/disks/write
-
Microsoft.Compute/galleries/images/read
-
Microsoft.Compute/galleries/images/versions/read
-
Microsoft.Compute/galleries/images/versions/write
-
Microsoft.Compute/galleries/images/write
-
Microsoft.Compute/galleries/read
-
Microsoft.Compute/galleries/write
-
Microsoft.Compute/snapshots/read
-
Microsoft.Compute/snapshots/write
-
Microsoft.Compute/snapshots/delete
-
Microsoft.Compute/virtualMachines/delete
-
Microsoft.Compute/virtualMachines/powerOff/action
-
Microsoft.Compute/virtualMachines/read
-
Microsoft.Compute/virtualMachines/write
例2.3 ID 管理リソースを作成するために必要なアクセス許可
-
Microsoft.ManagedIdentity/userAssignedIdentities/assign/action
-
Microsoft.ManagedIdentity/userAssignedIdentities/read
-
Microsoft.ManagedIdentity/userAssignedIdentities/write
例2.4 ネットワークリソースの作成に必要な権限
-
Microsoft.Network/dnsZones/A/write
-
Microsoft.Network/dnsZones/CNAME/write
-
Microsoft.Network/dnszones/CNAME/read
-
Microsoft.Network/dnszones/read
-
Microsoft.Network/loadBalancers/backendAddressPools/join/action
-
Microsoft.Network/loadBalancers/backendAddressPools/read
-
Microsoft.Network/loadBalancers/backendAddressPools/write
-
Microsoft.Network/loadBalancers/read
-
Microsoft.Network/loadBalancers/write
-
Microsoft.Network/networkInterfaces/delete
-
Microsoft.Network/networkInterfaces/join/action
-
Microsoft.Network/networkInterfaces/read
-
Microsoft.Network/networkInterfaces/write
-
Microsoft.Network/networkSecurityGroups/join/action
-
Microsoft.Network/networkSecurityGroups/read
-
Microsoft.Network/networkSecurityGroups/securityRules/delete
-
Microsoft.Network/networkSecurityGroups/securityRules/read
-
Microsoft.Network/networkSecurityGroups/securityRules/write
-
Microsoft.Network/networkSecurityGroups/write
-
Microsoft.Network/privateDnsZones/A/read
-
Microsoft.Network/privateDnsZones/A/write
-
Microsoft.Network/privateDnsZones/A/delete
-
Microsoft.Network/privateDnsZones/SOA/read
-
Microsoft.Network/privateDnsZones/read
-
Microsoft.Network/privateDnsZones/virtualNetworkLinks/read
-
Microsoft.Network/privateDnsZones/virtualNetworkLinks/write
-
Microsoft.Network/privateDnsZones/write
-
Microsoft.Network/publicIPAddresses/delete
-
Microsoft.Network/publicIPAddresses/join/action
-
Microsoft.Network/publicIPAddresses/read
-
Microsoft.Network/publicIPAddresses/write
-
Microsoft.Network/virtualNetworks/join/action
-
Microsoft.Network/virtualNetworks/read
-
Microsoft.Network/virtualNetworks/subnets/join/action
-
Microsoft.Network/virtualNetworks/subnets/read
-
Microsoft.Network/virtualNetworks/subnets/write
-
Microsoft.Network/virtualNetworks/write
Azure でプライベート OpenShift Container Platform クラスターを作成するために、以下のアクセス許可は必要ありません。
-
Microsoft.Network/dnsZones/A/write
-
Microsoft.Network/dnsZones/CNAME/write
-
Microsoft.Network/dnszones/CNAME/read
-
Microsoft.Network/dnszones/read
例2.5 リソースの健全性をチェックするために必要な権限
-
Microsoft.Resourcehealth/healthevent/Activated/action
-
Microsoft.Resourcehealth/healthevent/InProgress/action
-
Microsoft.Resourcehealth/healthevent/Pending/action
-
Microsoft.Resourcehealth/healthevent/Resolved/action
-
Microsoft.Resourcehealth/healthevent/Updated/action
例2.6 リソースグループの作成に必要なアクセス許可
-
Microsoft.Resources/subscriptions/resourceGroups/read
-
Microsoft.Resources/subscriptions/resourcegroups/write
例2.7 リソースタグの作成に必要なアクセス許可
-
Microsoft.Resources/tags/write
例2.8 ストレージリソースの作成に必要な権限
-
Microsoft.Storage/storageAccounts/blobServices/read
-
Microsoft.Storage/storageAccounts/blobServices/containers/write
-
Microsoft.Storage/storageAccounts/fileServices/read
-
Microsoft.Storage/storageAccounts/fileServices/shares/read
-
Microsoft.Storage/storageAccounts/fileServices/shares/write
-
Microsoft.Storage/storageAccounts/fileServices/shares/delete
-
Microsoft.Storage/storageAccounts/listKeys/action
-
Microsoft.Storage/storageAccounts/read
-
Microsoft.Storage/storageAccounts/write
例2.9 Marketplace 仮想マシンリソースを作成するためのオプションのアクセス許可
-
Microsoft.MarketplaceOrdering/offertypes/publishers/offers/plans/agreements/read
-
Microsoft.MarketplaceOrdering/offertypes/publishers/offers/plans/agreements/write
例2.10 コンピュートリソースを作成するためのオプションのアクセス許可
-
Microsoft.Compute/availabilitySets/delete
-
Microsoft.Compute/images/read
-
Microsoft.Compute/images/write
-
Microsoft.Compute/images/delete
例2.11 ユーザー管理の暗号化を有効にするためのオプションのアクセス許可
-
Microsoft.Compute/diskEncryptionSets/read
-
Microsoft.Compute/diskEncryptionSets/write
-
Microsoft.Compute/diskEncryptionSets/delete
-
Microsoft.KeyVault/vaults/read
-
Microsoft.KeyVault/vaults/write
-
Microsoft.KeyVault/vaults/delete
-
Microsoft.KeyVault/vaults/deploy/action
-
Microsoft.KeyVault/vaults/keys/read
-
Microsoft.KeyVault/vaults/keys/write
-
Microsoft.Features/providers/features/register/action
例2.12 NatGateway
アウトバウンドタイプを使用してクラスターをインストールするためのオプションの権限
-
Microsoft.Network/natGateways/read
-
Microsoft.Network/natGateways/write
例2.13 Azure ネットワークアドレス変換 (NAT) を使用してプライベートクラスターをインストールするためのオプションのアクセス許可
-
Microsoft.Network/natGateways/join/action
-
Microsoft.Network/natGateways/read
-
Microsoft.Network/natGateways/write
例2.14 Azure ファイアウォールを使用してプライベートクラスターをインストールするためのオプションのアクセス許可
-
Microsoft.Network/azureFirewalls/applicationRuleCollections/write
-
Microsoft.Network/azureFirewalls/read
-
Microsoft.Network/azureFirewalls/write
-
Microsoft.Network/routeTables/join/action
-
Microsoft.Network/routeTables/read
-
Microsoft.Network/routeTables/routes/read
-
Microsoft.Network/routeTables/routes/write
-
Microsoft.Network/routeTables/write
-
Microsoft.Network/virtualNetworks/peer/action
-
Microsoft.Network/virtualNetworks/virtualNetworkPeerings/read
-
Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write
例2.15 収集ブートストラップを実行するためのオプションの権限
-
Microsoft.Compute/virtualMachines/retrieveBootDiagnosticsData/action
Microsoft Azure で OpenShift Container Platform クラスターを削除するには、以下のアクセス許可が必要です。同じアクセス許可を使用して、Azure 上のプライベート OpenShift Container Platform クラスターを削除できます。
例2.16 承認リソースを削除するために必要な権限
-
Microsoft.Authorization/roleAssignments/delete
例2.17 コンピューティングリソースを削除するために必要な権限
-
Microsoft.Compute/disks/delete
-
Microsoft.Compute/galleries/delete
-
Microsoft.Compute/galleries/images/delete
-
Microsoft.Compute/galleries/images/versions/delete
-
Microsoft.Compute/virtualMachines/delete
例2.18 アイデンティティー管理リソースを削除するために必要な権限
-
Microsoft.ManagedIdentity/userAssignedIdentities/delete
例2.19 ネットワークリソースを削除するために必要な権限
-
Microsoft.Network/dnszones/read
-
Microsoft.Network/dnsZones/A/read
-
Microsoft.Network/dnsZones/A/delete
-
Microsoft.Network/dnsZones/CNAME/read
-
Microsoft.Network/dnsZones/CNAME/delete
-
Microsoft.Network/loadBalancers/delete
-
Microsoft.Network/networkInterfaces/delete
-
Microsoft.Network/networkSecurityGroups/delete
-
Microsoft.Network/privateDnsZones/read
-
Microsoft.Network/privateDnsZones/A/read
-
Microsoft.Network/privateDnsZones/delete
-
Microsoft.Network/privateDnsZones/virtualNetworkLinks/delete
-
Microsoft.Network/publicIPAddresses/delete
-
Microsoft.Network/virtualNetworks/delete
Azure 上のプライベート OpenShift Container Platform クラスターを削除するために、以下のアクセス許可は必要ありません。
-
Microsoft.Network/dnszones/read
-
Microsoft.Network/dnsZones/A/read
-
Microsoft.Network/dnsZones/A/delete
-
Microsoft.Network/dnsZones/CNAME/read
-
Microsoft.Network/dnsZones/CNAME/delete
例2.20 リソースの健全性をチェックするために必要な権限
-
Microsoft.Resourcehealth/healthevent/Activated/action
-
Microsoft.Resourcehealth/healthevent/Resolved/action
-
Microsoft.Resourcehealth/healthevent/Updated/action
例2.21 リソースグループを削除するために必要な権限
-
Microsoft.Resources/subscriptions/resourcegroups/delete
例2.22 ストレージリソースを削除するために必要な権限
-
Microsoft.Storage/storageAccounts/delete
-
Microsoft.Storage/storageAccounts/listKeys/action
Azure に OpenShift Container Platform をインストールするには、アクセス許可の範囲をサブスクリプションに限定する必要があります。後で、これらのアクセス許可の範囲を、インストーラーによって作成されたリソースグループに再設定できます。パブリック DNS ゾーンが別のリソースグループに存在する場合は、ネットワーク DNS ゾーンに関連する権限を常にサブスクリプションに適用する必要があります。デフォルトでは、OpenShift Container Platform インストールプログラムは Azure ID に Contributor
ロールを割り当てます。
OpenShift Container Platform クラスターを削除するときに、すべての権限をサブスクリプションに適用できます。
2.5.3. Azure マネージド ID の使用
インストールプログラムでは、インストールを完了するために Azure ID が必要です。システム割り当てまたはユーザー割り当てのマネージド ID を使用できます。
マネージド ID を使用できない場合は、サービスプリンシパルを使用できます。
手順
- システム割り当てのマネージド ID を使用している場合は、インストールプログラムを実行する仮想マシン上でそれを有効にします。
ユーザーが割り当てたマネージド ID を使用している場合は以下を行います。
- これを、インストールプログラムを実行する仮想マシンに割り当てます。
クライアント ID を記録します。この値は、クラスターをインストールするときに必要になります。
ユーザー割り当てマネージド ID の詳細を表示する場合は、Microsoft Azure ドキュメントで ユーザー割り当てマネージド ID のリスト を参照してください。
- 必要なパーミッションがマネージド ID に割り当てられていることを確認します。
2.5.4. サービスプリンシパルの作成
インストールプログラムでは、インストールを完了するために Azure ID が必要です。サービスプリンシパルを使用できます。
サービスプリンシパルを使用できない場合は、マネージド ID を使用できます。
前提条件
- Azure CLI をインストールまたは更新している。
- Azure サブスクリプション ID がある。
-
サービスプリンシパルに
Contributor
ロールおよびUser Administrator Access
ロールを割り当てない場合は、必要な Azure アクセス許可を持つカスタムロールを作成しています。
手順
次のコマンドを実行して、アカウントのサービスプリンシパルを作成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow az ad sp create-for-rbac --role <role_name> \ --name <service_principal> \ --scopes /subscriptions/<subscription_id>
$ az ad sp create-for-rbac --role <role_name> \
1 --name <service_principal> \
2 --scopes /subscriptions/<subscription_id>
3 出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Creating 'Contributor' role assignment under scope '/subscriptions/<subscription_id>' The output includes credentials that you must protect. Be sure that you do not include these credentials in your code or check the credentials into your source control. For more information, see https://aka.ms/azadsp-cli { "appId": "axxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "displayName": <service_principal>", "password": "00000000-0000-0000-0000-000000000000", "tenantId": "8xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }
Creating 'Contributor' role assignment under scope '/subscriptions/<subscription_id>' The output includes credentials that you must protect. Be sure that you do not include these credentials in your code or check the credentials into your source control. For more information, see https://aka.ms/azadsp-cli { "appId": "axxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "displayName": <service_principal>", "password": "00000000-0000-0000-0000-000000000000", "tenantId": "8xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }
-
出力から
appId
パラメーターとpassword
パラメーターの値を記録します。クラスターをインストールするときにこれらの値が必要です。 Contributor
ロールをサービスプリンシパルに適用した場合は、次のコマンドを実行してUser Administrator Access
ロールを割り当てます。Copy to Clipboard Copied! Toggle word wrap Toggle overflow az role assignment create --role "User Access Administrator" \ --assignee-object-id $(az ad sp show --id <appId> --query id -o tsv)
$ az role assignment create --role "User Access Administrator" \ --assignee-object-id $(az ad sp show --id <appId> --query id -o tsv)
1 --scope /subscriptions/<subscription_id>
2