You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Grant the DiskEncryptionSet resource access to the key vault
@@ -81,46 +81,37 @@ Use the DiskEncryptionSet and resource groups you created on the prior steps, an
81
81
82
82
```azurecli-interactive
83
83
# Retrieve the DiskEncryptionSet value and set a variable
84
-
desIdentity=$(az disk-encryption-set show -n myDiskEncryptionSetName -g myResourceGroup--query [identity.principalId] -o tsv)
84
+
desIdentity=$(az disk-encryption-set show -n myDiskEncryptionSetName -g myResourceGroup--query [identity.principalId] -o tsv)
85
85
86
86
# Update security policy settings
87
-
az keyvault set-policy -n myKeyVaultName -g myResourceGroup--object-id $desIdentity --key-permissions wrapkey unwrapkey get
87
+
az keyvault set-policy -n myKeyVaultName -g myResourceGroup--object-id $desIdentity --key-permissions wrapkey unwrapkey get
88
88
89
89
# Assign the reader role
90
90
az role assignment create --assignee $desIdentity --role Reader --scope $keyVaultId
91
91
```
92
92
93
93
## Create a new AKS cluster and encrypt the OS disk with a customer-manged key
94
94
95
-
Create a new resource group and AKS cluster, then use your key to encrypt the OS disk.
95
+
Create a new resource group and AKS cluster, then use your key to encrypt the OS disk. Customer managed key is only supported in kubernetes versions greater than 1.17
96
96
97
97
```azurecli-interactive
98
98
# Retrieve the DiskEncryptionSet value and set a variable
az group create -n myResourceGroup-l myAzureRegionName
103
103
104
104
# Create the AKS cluster
105
-
az aks create -n myAKSCluster -g myResourceGroup --node-osdisk-diskencryptionsetid diskEncryptionId
105
+
az aks create -n myAKSCluster -g myResourceGroup --node-osdisk-diskencryptionset-id $diskEncryptionSetId --kubernetes-version 1.17.0
106
106
```
107
107
108
-
## Add a node pool to an existing AKS cluster and encrypt the OS disk with a customer-managed key
109
-
110
-
New nodepools do not use encrypted disks by default. You can add a new node pool to an existing cluster and encrypt the OS disk with your own key by using the following command.
111
-
112
-
```azurecli-interactive
113
-
# Add a nodepool to an existing cluster with BYOK encryption
When new node pools are added to the cluster created above, the customer managed key provided during the create is used to encrypt the OS disk
116
109
117
110
## Encrypt your AKS cluster data disk with a customer-managed key
118
111
119
112
You can also encrypt the AKS data disks with your own keys. Replace myResourceGroup and myDiskEncryptionSetName with your real values, and apply the yaml.
120
113
121
-
### Deploy the sample image from ACR to AKS
122
-
123
-
Ensure you have the proper AKS credentials
114
+
Ensure you have the proper AKS credentials. The Service principal will need to have contributor access to the resource group where the diskencryptionset is present. Otherwise, you will get an error suggesting that the service principal does not have permissions.
124
115
125
116
Create a file called **byok-azure-disk.yaml** that contains the following information. Replace myResourceGroup and myDiskEncrptionSetName with your values.
0 commit comments