Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 4. Enabling user-managed encryption for Azure
In OpenShift Container Platform version 4.12, you can install a cluster with a user-managed encryption key in Azure. To enable this feature, you can prepare an Azure DiskEncryptionSet before installation, modify the
install-config.yaml
4.1. Preparing an Azure Disk Encryption Set for Day2 Operator Link kopierenLink in die Zwischenablage kopiert!
The OpenShift Container Platform installation program can use an existing Disk Encryption Set with a user-managed key. To enable this feature, create a
DiskEncryptionSet
Prerequisite
You enabled the
feature in your Azure subscription. For more information, see "Use the Azure portal to enable end-to-end encryption using encryption at host". .ProcedureEncryptionAtHostMark the node from the
cluster resource group as unschedulable by using the following command:encyptionAtHost$ oc adm cordon <node_name>Evacuate the pods from the compute node. There are several ways to do this. For example, you can evacuate all the pods or the selected pods on a node:
$ oc adm drain <compute_node> [--pod-selector=<pod_selector>]NoteFor other options to evacuate pods from a node, see the "Understanding how to evacuate pods on nodes" section.
De-allocate the node by running the following command:
$ az vm deallocate -n <node_name> -g <cluster_resource_group>Set the
property toencryptionAtHostby running the following command:true$ az vm update -n <node_name> -g <cluster_resource_group> --set securityProfile.encryptionAtHost=trueStart the node by running the following commands:
$ az vm start -n <node_name> -g <cluster_resource_group>Mark the node as schedulable by using the following command:
$ oc adm uncordon <node_name>Verify that all cluster Operators are available:
$ oc get clusteroperatorsAll Operators should show
,AVAILABLE=True, andPROGRESSING=False.DEGRADED=False-
Repeat the above steps on all the nodes that run .
encryptionAtHost
If you want to enable encryption for your host during cluster installation, specify the following parameters in the
install-config.yaml
compute.platform.azure.encryptionAtHost
controlPlane.platform.azure.encryptionAtHost
platform.azure.defaultMachinePlatform.encryptionAtHost
4.2. Preparing an Azure Disk Encryption Set Link kopierenLink in die Zwischenablage kopiert!
The OpenShift Container Platform installer can use an existing Disk Encryption Set with a user-managed key. To enable this feature, you can create a Disk Encryption Set in Azure and provide the key to the installer.
Procedure
Set the following environment variables for the Azure resource group by running the following command:
$ export RESOURCEGROUP="<resource_group>" \1 LOCATION="<location>"2 - 1
- Specifies the name of the Azure resource group where you will create the Disk Encryption Set and encryption key. To avoid losing access to your keys after destroying the cluster, you should create the Disk Encryption Set in a different resource group than the resource group where you install the cluster.
- 2
- Specifies the Azure location where you will create the resource group.
Set the following environment variables for the Azure Key Vault and Disk Encryption Set by running the following command:
$ export KEYVAULT_NAME="<keyvault_name>" \1 KEYVAULT_KEY_NAME="<keyvault_key_name>" \2 DISK_ENCRYPTION_SET_NAME="<disk_encryption_set_name>"3 Set the environment variable for the ID of your Azure Service Principal by running the following command:
$ export CLUSTER_SP_ID="<service_principal_id>"1 - 1
- Specifies the ID of the service principal you will use for this installation.
Enable host-level encryption in Azure by running the following commands:
$ az feature register --namespace "Microsoft.Compute" --name "EncryptionAtHost"$ az feature show --namespace Microsoft.Compute --name EncryptionAtHost$ az provider register -n Microsoft.ComputeCreate an Azure Resource Group to hold the disk encryption set and associated resources by running the following command:
$ az group create --name $RESOURCEGROUP --location $LOCATIONCreate an Azure key vault by running the following command:
$ az keyvault create -n $KEYVAULT_NAME -g $RESOURCEGROUP -l $LOCATION \ --enable-purge-protection trueCreate an encryption key in the key vault by running the following command:
$ az keyvault key create --vault-name $KEYVAULT_NAME -n $KEYVAULT_KEY_NAME \ --protection softwareCapture the ID of the key vault by running the following command:
$ KEYVAULT_ID=$(az keyvault show --name $KEYVAULT_NAME --query "[id]" -o tsv)Capture the key URL in the key vault by running the following command:
$ KEYVAULT_KEY_URL=$(az keyvault key show --vault-name $KEYVAULT_NAME --name \ $KEYVAULT_KEY_NAME --query "[key.kid]" -o tsv)Create a disk encryption set by running the following command:
$ az disk-encryption-set create -n $DISK_ENCRYPTION_SET_NAME -l $LOCATION -g \ $RESOURCEGROUP --source-vault $KEYVAULT_ID --key-url $KEYVAULT_KEY_URLGrant the DiskEncryptionSet resource access to the key vault by running the following commands:
$ DES_IDENTITY=$(az disk-encryption-set show -n $DISK_ENCRYPTION_SET_NAME -g \ $RESOURCEGROUP --query "[identity.principalId]" -o tsv)$ az keyvault set-policy -n $KEYVAULT_NAME -g $RESOURCEGROUP --object-id \ $DES_IDENTITY --key-permissions wrapkey unwrapkey getGrant the Azure Service Principal permission to read the DiskEncryptionSet by running the following commands:
$ DES_RESOURCE_ID=$(az disk-encryption-set show -n $DISK_ENCRYPTION_SET_NAME -g \ $RESOURCEGROUP --query "[id]" -o tsv)$ az role assignment create --assignee $CLUSTER_SP_ID --role "<reader_role>" \1 --scope $DES_RESOURCE_ID -o jsonc- 1
- Specifies an Azure role with read permissions to the disk encryption set. You can use the
Ownerrole or a custom role with the necessary permissions.
4.3. Next steps Link kopierenLink in die Zwischenablage kopiert!
Install an OpenShift Container Platform cluster:
- Install a cluster with customizations on installer-provisioned infrastructure
- Install a cluster with network customizations on installer-provisioned infrastructure
- Install a cluster into an existing VNet on installer-provisioned infrastructure
- Install a private cluster on installer-provisioned infrastructure
- Install a cluster into an government region on installer-provisioned infrastructure