Static Provisioning Credentials Management
This document details how credentials flow through the Scality CSI Driver for S3 for static provisioning, supporting both driver-level (global) and volume-level (per-volume) authentication methods.
graph LR
subgraph driver["Driver-Level Credentials (Default)"]
HelmChart["Helm Chart values.yaml"]
DriverSecret["Kubernetes Secret"]
DriverEnv["Environment Variables in CSI Container"]
end
subgraph volume["Volume-Level Credentials"]
PVSpec["Persistent Volume spec (csi.authenticationSource=secret + csi.nodePublishSecretRef)"]
VolumeSecret["Kubernetes Secret (referenced by PV spec)"]
end
CSI["Scality CSI Driver for S3 Node Service"]
MP["mount-s3 process per volume"]
S3["S3 Storage"]
HelmChart --> DriverSecret
DriverSecret --> DriverEnv
DriverEnv -->|"Default credentials for all volumes"| CSI
PVSpec --> VolumeSecret
VolumeSecret -->|"Overrides credentials for this volume"| CSI
CSI -->|"Selected credentials"| MP
MP -->|"Authenticated requests"| S3
There are 2 ways to manage credentials:
- Driver-Level Authentication - Global kubernetes secret containing credentials configured during driver installation
- Persistent Volume-Level Authentication - Per-volume secrets containing credentials (set via Persistent Volume specifications)
For Kubernetes secrets used in both driver-level and volume-level authentication, the credentials should be stored using the same key names as specified in the values.yaml file. Default key names are:
access_key_id
for Access Key IDsecret_access_key
for Secret Access Keysession_token
(optional) for Session Token
Note
Use stringData
(not data
) because the Scality CSI driver for S3 expects plain text credential. Secret security is controlled by Kubernetes RBAC permissions.
Kubernetes Secret with RING S3 credentials | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
Method 1: Driver-Level Authentication
Global secret configured during driver installation. All volumes use this secret unless overridden.
Step 1: Install with Helm (referencing secret) | |
---|---|
1 2 3 |
|
Step 2: Create PersistentVolume (no credentials needed) | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Method 2: Volume-Level Authentication
Each persistent volume can use different secrets stored in Kubernetes. The secret definition is similar to the driver-level authentication secret.
For volume-level authentication, the secret is referenced in the PersistentVolume spec via the nodePublishSecretRef
field and the authenticationSource
field is set to secret
.
This overrides the driver-level secret for this volume.
PersistentVolume | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Credential Priority Chain
The Scality CSI driver for S3 evaluates credentials in the following order, using the first valid credentials found:
Persistent Volume-Level Secrets (Priority 1 - Highest)
- Specified in PersistentVolume spec via
csi.authenticationSource: secret
andcsi.nodePublishSecretRef
- Allows different secrets per persistent volume
- Overrides driver-level settings
- Use case: Multi-tenant environments
- Example: Secret Authentication
Driver-Level Secret (Priority 2)
- Configured in Helm chart values.yaml file
- Applies to all volumes unless overridden
- Stored in driver namespace
- Use case: Single-tenant clusters
Common Patterns for multi-tenant environments
One set of shared secret for all volumes. This is the default pattern for single-tenant environments.
Single-Tenant Pattern (Driver-Level) | |
---|---|
1 2 3 |
|
Different secrets per tenant/application. This is the default pattern for multi-tenant environments.
Multi-Tenant Pattern (Volume-Level) | |
---|---|
1 2 3 |
|