Skip to content

Commit 5855e4f

Browse files
committed
OCPBUGS#984 cluster identity should be granted 'Contributor' role to disk-encryption-set in azure install
1 parent cd7b53a commit 5855e4f

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

modules/installation-azure-finalizing-encryption.adoc

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,39 @@ $ az role assignment create --role "<privileged_role>" \// <1>
4141
<1> Specifies an Azure role that has read/write permissions to the disk encryption set. You can use the `Owner` role or a custom role with the necessary permissions.
4242
<2> Specifies the identity of the cluster resource group.
4343
+
44+
. Obtain the `id` of the disk encryption set you created prior to installation by running the following command:
45+
+
46+
[source,terminal]
47+
----
48+
$ az disk-encryption-set show -n <disk_encryption_set_name> \// <1>
49+
--resource-group <resource_group_name> <2>
50+
----
51+
<1> Specifies the name of the disk encryption set.
52+
<2> Specifies the resource group that contains the disk encryption set.
53+
The `id` is in the format of `"/subscriptions/.../resourceGroups/.../providers/Microsoft.Compute/diskEncryptionSets/..."`.
54+
+
55+
. Obtain the identity of the cluster service principal by running the following command:
56+
+
57+
[source,terminal]
58+
----
59+
$ az identity show -g <cluster_resource_group> \// <1>
60+
-n <cluster_service_principal_name> \// <2>
61+
--query principalId --out tsv
62+
----
63+
<1> Specifies the name of the cluster resource group created by the installation program.
64+
<2> Specifies the name of the cluster service principal created by the installation program.
65+
The identity is in the format of `12345678-1234-1234-1234-1234567890`.
66+
. Create a role assignment that grants the cluster service principal `Contributor` privileges to the disk encryption set by running the following command:
67+
+
68+
[source,terminal]
69+
----
70+
$ az role assignment create --assignee <cluster_service_principal_id> \// <1>
71+
--role 'Contributor' \//
72+
--scope <disk_encryption_set_id> \// <2>
73+
----
74+
<1> Specifies the ID of the cluster service principal obtained in the previous step.
75+
<2> Specifies the ID of the disk encryption set.
76+
+
4477
. Create a storage class that uses the user-managed disk encryption set:
4578
.. Save the following storage class definition to a file, for example `storage-class-definition.yaml`:
4679
+
@@ -55,7 +88,7 @@ parameters:
5588
skuname: Premium_LRS
5689
kind: Managed
5790
diskEncryptionSetID: "<disk_encryption_set_ID>" <1>
58-
resourceGroup: <resource_group_name> <2>
91+
resourceGroup: "<resource_group_name>" <2>
5992
reclaimPolicy: Delete
6093
allowVolumeExpansion: true
6194
volumeBindingMode: WaitForFirstConsumer

0 commit comments

Comments
 (0)