Configuring access by using vaulttenantsa
Configure the key management system (KMS) by using vaulttenantsa to
enable authentication with Vault through a service account.
Before you begin
- Ensure that the Fusion Data Foundation cluster is in the
Readystate. -
On the external key management system (KMS):
- Ensure that a policy with a token exists and that the key value backend path in
Vaultis enabled. - Ensure that the
Vaultservers use signed certificates.
- Ensure that a policy with a token exists and that the key value backend path in
-
Ensure that the service account is created in the tenant namespace.
For example:
cat <<EOF | oc create -f - apiVersion: v1 kind: ServiceAccount metadata: name: ceph-csi-vault-sa EOF
- The Fusion Data Foundation cluster is in Ready state.
- On the external key management system (KMS):
- Ensure that a policy exists and the key value backend path in Vault is enabled.
- Ensure that you are using signed certificates on your Vault servers.
About this task
You must configure the Kubernetes authentication method before Fusion Data Foundation can authenticate with and start using
Vault. The following instructions create and configure
serviceAccount, ClusterRole, and
ClusterRoleBinding required to allow Fusion Data Foundation to authenticate with
Vault.
Procedure
Example
To create a StorageClass that uses the vaulttenantsa method for PV encryption,
you must either edit the existing ConfigMap or create a ConfigMap named
csi-kms-connection-details that will hold all the information needed to establish
the connection with Vault.
csi-kms-connection-detail
ConfigMap:apiVersion: v1
data:
vault-tenant-sa: |-
{
"encryptionKMSType": "vaulttenantsa",
"vaultAddress": "<https://hostname_or_ip_of_vault_server:port>",
"vaultTLSServerName": "<vault TLS server name>",
"vaultAuthPath": "/v1/auth/kubernetes/login",
"vaultAuthNamespace": "<vault auth namespace name>"
"vaultNamespace": "<vault namespace name>",
"vaultBackendPath": "<vault backend path name>",
"vaultCAFromSecret": "<secret containing CA cert>",
"vaultClientCertFromSecret": "<secret containing client cert>",
"vaultClientCertKeyFromSecret": "<secret containing client private key>",
"tenantSAName": "<service account name in the tenant namespace>"
}
metadata:
name: csi-kms-connection-details| Value | Description |
|---|---|
encryptionKMSType
|
Set to vaulttenantsa to use service accounts for
authentication with vault. |
vaultAddress
|
The hostname or IP address of the vault server with the port number. |
vaultTLSServerName
|
(Optional) The vault TLS server name. |
vaultAuthPath
|
(Optional) The path where Kubernetes auth method is enabled in Vault. The default path is kubernetes. If the auth method is enabled in a different path other than kubernetes, this variable needs to be set as "/v1/auth/<path>/login". |
vaultAuthNamespace
|
(Optional) The Vault namespace where Kubernetes auth method is enabled. |
vaultNamespace
|
(Optional) The Vault namespace where the backend path being used to store the keys exists. |
vaultBackendPath
|
The backend path in Vault where the encryption keys will be stored. |
vaultCAFromSecret
|
The secret in the Fusion Data Foundation cluster containing the CA certificate from Vault. |
vaultClientCertFromSecret
|
The secret in the Fusion Data Foundation cluster containing the client certificate from Vault. |
vaultClientCertKeyFromSecret
|
The secret in the Fusion Data Foundation cluster containing the client private key from Vault. |
tenantSAName
|
(Optional) The service account name in the tenant namespace. The
default value is ceph-csi-vault-sa. If a different name is to be used, this
variable has to be set accordingly. |