External Secret Store for Self-Managed DPE
From version 17.2.0, a self-managed Data Processing Engine (DPE) can read its secrets from an external secret store, such as Azure Key Vault, instead of the Helm values file. This page describes the setup with Azure Key Vault. For a general description of self-managed DPE installation, see Kubernetes-Based Hybrid DPE Deployment Guide.
How the external secret store works
By default, the Helm values file generated for a self-managed DPE contains the DPE secrets in plain text, and the DPE Helm chart stores them in Kubernetes Secrets.
When you set global.hybridDeployment.csiConfig in the Helm values file, DPE reads its secrets from the secret store through the Secrets Store CSI Driver instead:
-
The secrets are kept only in the secret store.
-
The Secrets Store CSI Driver mounts them as read-only files into the DPE pod (
/mnt/secrets-store) when the pod starts. -
The DPE Helm chart does not create the
dpe-secret,dpe-encryption-keys-secret, anddpe-encryption-password-secretKubernetes Secrets, so the secrets are not stored in Kubernetes Secrets or etcd. -
The Helm values file no longer contains any secrets.
Prerequisites
-
A self-managed DPE on Kubernetes, version 17.2.0 or later, and the Helm values file generated for it in Ataccama Cloud Portal. See Local installation.
-
kubectland Helm access to the cluster. -
The Secrets Store CSI Driver and the provider for your secret store installed in the cluster. See Prepare the cluster.
-
An identity that the provider uses to read the secrets. The identity needs the
getandlistpermissions on the secrets in the vault. See Azure authentication options.
Prepare the cluster
The Secrets Store CSI Driver and the Azure Key Vault provider are two separate components.
Install both before you deploy DPE with csiConfig set.
-
Install the Secrets Store CSI Driver:
Install the Secrets Store CSI Driverhelm repo add secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts helm repo update helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver \ --namespace kube-system \ --set syncSecret.enabled=falsesyncSecret.enabled=falsemakes the driver only mount the secrets as files and not copy them to Kubernetes Secrets. This is the mode the DPE Helm chart uses. -
Install the Azure Key Vault provider:
Install the Azure Key Vault providerhelm repo add csi-secrets-store-provider-azure https://azure.github.io/secrets-store-csi-driver-provider-azure/charts helm repo update helm install azure-provider csi-secrets-store-provider-azure/csi-secrets-store-provider-azure \ --namespace kube-systemIf the Secrets Store CSI Driver is already installed as a separate Helm release, as in the previous step, the provider chart conflicts with it on the shared
ServiceAccount. In that case, skip the driver bundled with the provider chart:Install the Azure Key Vault provider without the bundled driverhelm install azure-provider csi-secrets-store-provider-azure/csi-secrets-store-provider-azure \ --namespace kube-system \ --set secrets-store-csi-driver.install=false -
Verify that both components are running:
Verify the Secrets Store CSI Driver and the Azure Key Vault providerkubectl get daemonset -n kube-system -l app=secrets-store-csi-driver kubectl get daemonset -n kube-system -l app=csi-secrets-store-provider-azure kubectl get pods -n kube-system | grep -E "secrets-store|csi-azure"All pods must be in the
Runningstate before you deploy DPE.
|
The |
DPE secrets and where to find them
The following table lists the secrets that DPE reads from the secret store.
Each secret is identified by a key in global.hybridDeployment.csiConfig.objectNames.
The second column shows where you can find the value in the Helm values file generated in Ataccama Cloud Portal.
Key in objectNames |
Field in the generated values file | Notes |
|---|---|---|
|
|
DPE JWT private key. Store the value as it is. |
|
|
Data Processing Module (DPM) JWT key. Store the value as it is. |
|
|
DPM JWT key fingerprint. Store the value as it is. |
|
|
ONE Object Storage (MinIO) user. Store the value as it is. |
|
|
ONE Object Storage (MinIO) password. Store the value as it is. |
|
|
Encryption keystore (JCEKS).
The values file contains it base64-encoded.
Store the base64 string and set |
|
|
Encryption keystore password. The values file contains it base64-encoded. Store the decoded password. |
|
- |
Optional.
The contents of a DPE license file, mounted as |
All keys except licenseFile are required.
If one of them is missing, Helm fails with the error global.hybridDeployment.csiConfig.objectNames.<key> is required when csiConfig is set.
csiConfig reference
Configure the secret store in global.hybridDeployment.csiConfig.
From this configuration, the DPE Helm chart creates a SecretProviderClass resource named dpe-secret-provider and mounts it into the DPE pod.
| Field | Description |
|---|---|
|
Required.
The provider of the Secrets Store CSI Driver: |
|
Provider-specific parameters.
They are passed as they are to |
|
Optional. The name of a Kubernetes Secret with the credentials the provider uses to access the secret store, for example, the client ID and client secret of an Azure service principal. The Secret must exist in the DPE namespace. |
|
The file names under which the secrets are mounted.
Each value must match the |
When you configure the secrets, follow these rules:
-
Each value in
objectNamesmust be equal to theobjectAliasof the corresponding entry inparameters.objects. We recommend using the key itself as the alias, for example,dpeJWTPrivateKey: dpeJWTPrivateKey. -
The
encryptionKeystoreentry inparameters.objectsneedsobjectEncoding: base64. -
global.hybridDeployment.imagePullSecretsmust stay in the values file. See Limitations of the external secret store.
The following example uses an Azure VM managed identity:
csiConfig for Azure Key Vaultglobal:
hybridDeployment:
enabled: true
csiConfig:
provider: azure
parameters:
usePodIdentity: "false"
useVMManagedIdentity: "true"
keyvaultName: "<KEY_VAULT_NAME>"
tenantId: "<TENANT_ID>"
objects: |
array:
- |
objectName: ataccama--dpe-prod--dpeJWTPrivateKey
objectType: secret
objectAlias: dpeJWTPrivateKey
- |
objectName: ataccama--dpe-prod--dpmJWTKeyContent
objectType: secret
objectAlias: dpmJWTKeyContent
- |
objectName: ataccama--dpe-prod--dpmJWTKeyFingerprint
objectType: secret
objectAlias: dpmJWTKeyFingerprint
- |
objectName: ataccama--dpe-prod--minioRootUser
objectType: secret
objectAlias: minioRootUser
- |
objectName: ataccama--dpe-prod--minioRootPassword
objectType: secret
objectAlias: minioRootPassword
- |
objectName: ataccama--dpe-prod--encryptionKeystore
objectType: secret
objectAlias: encryptionKeystore
objectEncoding: base64
- |
objectName: ataccama--dpe-prod--encryptionPassword
objectType: secret
objectAlias: encryptionPassword
objectNames:
dpeJWTPrivateKey: dpeJWTPrivateKey
dpmJWTKeyContent: dpmJWTKeyContent
dpmJWTKeyFingerprint: dpmJWTKeyFingerprint
minioRootUser: minioRootUser
minioRootPassword: minioRootPassword
encryptionKeystore: encryptionKeystore
encryptionPassword: encryptionPassword
Azure authentication options
The Azure Key Vault provider supports the following ways to authenticate to the vault.
Whichever option you choose, the identity needs the get and list permissions on the secrets in the vault.
| Option | Settings in csiConfig |
|---|---|
VM system-assigned managed identity |
|
User-assigned managed identity |
|
Service principal |
|
Azure AD Pod Identity (legacy) |
|
All options also need keyvaultName, tenantId, and objects in parameters.
Service principal credentials
For a service principal, create a Kubernetes Secret with the client ID and client secret in the DPE namespace before you deploy DPE:
apiVersion: v1
kind: Secret
metadata:
name: dpe-akv-sp-creds
type: Opaque
stringData:
clientId: "<CLIENT_ID>"
clientSecret: "<CLIENT_SECRET>"
Apply the Secret to the DPE namespace:
kubectl apply -f dpe-akv-sp-creds.yaml -n <DPE_LABEL>
Replace <DPE_LABEL> with the label of your DPE, which is also the name of the DPE namespace.
Then set nodePublishSecretRef: dpe-akv-sp-creds in csiConfig.
|
Put the client ID only in this Kubernetes Secret.
Do not add Do not commit the Secret file to version control. |
Migrate an existing self-managed DPE
To move the secrets of an existing self-managed DPE to Azure Key Vault, use the setup-csi-secrets.ps1 PowerShell script. In one run, the script:
-
Uploads the secrets from the existing values file to Azure Key Vault.
-
Generates a new values file,
values-csi.ymlby default, with the secrets removed andcsiConfigfilled in. -
For service principal authentication, also generates the template of the Kubernetes Secret with the service principal credentials.
Script prerequisites
-
PowerShell 5.1 or later.
-
Azure CLI, logged in with
az login, with permission to set secrets in the target vault. -
The powershell-yaml module. If it is missing, the script installs it for the current user.
-
The values file of the existing DPE installation.
Script parameters
| Parameter | Required | Description |
|---|---|---|
|
Yes |
The name of the Azure Key Vault. |
|
Yes |
The first part of the secret names in the vault.
Identifies the deployment group, for example, |
|
Yes |
The Azure tenant ID.
Written to |
|
Yes |
How the provider authenticates to the vault: |
|
For |
The client ID of the user-assigned managed identity or of the service principal. |
|
No |
The name of the Kubernetes Secret with the service principal credentials.
Used only with Default: |
|
No |
The second part of the secret names in the vault: the Kubernetes namespace DPE runs in.
If not set, the script uses If that is not set either, the script takes the namespace from |
|
No |
The existing values file with the secrets. Default: |
|
No |
The generated values file. Default: |
|
No |
Dry run. Shows which secrets would be uploaded without changing the vault. |
Secret names in the vault
The script names the secrets <Prefix>--<Namespace>--<key>, for example, ataccama—dpe-prod—dpeJWTPrivateKey.
The keys are those listed in DPE secrets and where to find them.
In the generated csiConfig, the vault secret name is the objectName, and the key is the objectAlias.
What the script changes
The script uploads the seven required secrets as described in DPE secrets and where to find them.
It does not upload licenseFile.
In the generated values file, the script:
-
Removes
JWT.key_private,JWT.key_content,dpm.JWT.key_content,dpm.JWT.key_fp, the wholeglobal.minioblock,global.dataEncryption.password, andglobal.dataEncryption.peripheralKeystoreorglobal.dataEncryption.keystore. -
Adds
global.hybridDeployment.csiConfigwithprovider: azure, the authentication parameters for the chosen-AuthMethod,keyvaultName,tenantId,objects, andobjectNames. ForServicePrincipal, it also setsnodePublishSecretRef. -
Keeps all other values unchanged.
For ServicePrincipal, the script also writes <SpSecretName>.yaml next to the generated values file, with clientId filled in.
Run the migration
-
Check what the script would upload with a dry run:
Dry run of the migration script.\setup-csi-secrets.ps1 ` -VaultName <KEY_VAULT_NAME> ` -Prefix ataccama ` -TenantId <TENANT_ID> ` -AuthMethod VMManagedIdentity ` -ValuesFile values.yml ` -WhatIf -
Run the script without
-WhatIf. For example:VM system-assigned managed identity.\setup-csi-secrets.ps1 ` -VaultName <KEY_VAULT_NAME> ` -Prefix ataccama ` -TenantId <TENANT_ID> ` -AuthMethod VMManagedIdentityUser-assigned managed identity.\setup-csi-secrets.ps1 ` -VaultName <KEY_VAULT_NAME> ` -Prefix ataccama ` -TenantId <TENANT_ID> ` -AuthMethod UserManagedIdentity ` -ClientId <CLIENT_ID>Service principal.\setup-csi-secrets.ps1 ` -VaultName <KEY_VAULT_NAME> ` -Prefix ataccama ` -TenantId <TENANT_ID> ` -AuthMethod ServicePrincipal ` -ClientId <CLIENT_ID> -
Review the generated
values-csi.ymlfile. Make sure it containsglobal.hybridDeployment.imagePullSecretsand any other environment-specific settings from your original values file. -
If you use
ServicePrincipal, set up the service principal credentials:-
Fill in
clientSecretin the generateddpe-akv-sp-creds.yamlfile. -
Apply the file to the DPE namespace:
Apply the service principal credentials Secretkubectl apply -f dpe-akv-sp-creds.yaml -n <DPE_LABEL>
-
-
Make sure the managed identity or service principal used by the Azure Key Vault provider has the
getandlistpermissions on the secrets in the vault. -
Upgrade the DPE with the generated values file. Use the same
helm upgrade --installcommand as for the original installation, withvalues-csi.ymlinstead of the original values file. -
Store the original values file securely or delete it, as it still contains the secrets.
What happens during the upgrade
-
Helm deletes the Kubernetes Secrets that the DPE chart created before:
dpe-secret,dpe-encryption-keys-secret, anddpe-encryption-password-secret. -
The Secrets Store CSI Driver mounts the secrets when the DPE pod starts. The DPE pod must restart to use them. If it doesn’t restart on its own, restart it:
Restart the DPE deploymentkubectl rollout restart deployment -n <DPE_LABEL>
DPE reads the secrets only when the pod starts. If you change a secret in the vault later, restart the DPE pod again.
Limitations of the external secret store
-
global.hybridDeployment.imagePullSecretsmust stay in the values file. Kubernetes needs the image pull secrets to download the DPE image before any volume is mounted, so they can’t come from the secret store.
Troubleshooting
Error provider not found: provider "azure"
The Azure Key Vault provider is not installed in the cluster. Run the verification commands from Prepare the cluster and install the provider if it is missing.
Error csiConfig.objectNames.<key> is required
One of the required keys is missing in csiConfig.objectNames.
Add all keys listed in DPE secrets and where to find them.
Was this page useful?