Scaleway Secret Manager provider for Secrets Store CSI Driver allows you to get secrets stored in Scaleway Secret Manager and use the Secrets Store CSI driver interface to mount them into Kubernetes pods.
Install the Secrets Store CSI Driver in your Kubernetes cluster.
The recommended installation method is via Helm 3:
helm repo add scaleway https://helm.scw.cloud/
helm repo update
helm upgrade --install scaleway-secrets-store-csi --namespace kube-system scaleway/scaleway-secrets-store-csiThe values file is available here: values.yaml.
You can also install using the deployment config in the deployment folder:
kubectl apply -n kube-system -f deployment/secrets-store-csi-driver-provider-scw.yamlTo authenticate to Scaleway, create a Kubernetes Secret with your credentials:
apiVersion: v1
kind: Secret
metadata:
name: scaleway-credentials
namespace: default
type: Opaque
stringData:
accessKey: "my-access-key"
secretKey: "my-secret-key"Note
The provider does not support authentication with a Kubernetes Service Account yet.
Create a SecretProviderClass to define which secrets to mount:
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: scaleway-provider
namespace: default
spec:
provider: scaleway
parameters:
apiURL: "https://api.scaleway.com"
insecure: "false"
defaultOrganizationID: "573e26e8-45b7-4859-aa81-547de6e9acff"
defaultProjectID: "6a4027ce-58c3-4adb-9b69-7ff6e1f317d2"
defaultRegion: "fr-par"
objects: |
- secretID: "e6a5d04a-c2c2-49a3-8180-09452bf64e26"
revision: "latest_enabled"
targetPath: "my-secret"
- projectID: "dfdc0cab-c99b-479d-a8f0-1df78cd9f67e"
secretPath: "/test"
secretName: "my-other-secret"
revision: "latest_enabled"To access a secret version by its ID, specify the secretID field:
objects: |
- secretID: "e6a5d04a-c2c2-49a3-8180-09452bf64e26"
revision: "latest_enabled"
targetPath: "my-secret"Fields:
secretID: The UUID of the secretrevision: The revision to access e.g., "latest_enabled", "1", "2", etc. (optional, defaults tolatest_enabled)targetPath: The relative path where the secret will be mounted
To access a secret version by its path, specify the secretPath and secretName fields:
objects: |
- projectID: "dfdc0cab-c99b-479d-a8f0-1df78cd9f67e"
secretPath: "/test"
secretName: "my-other-secret"
revision: "latest_enabled"Fields:
projectID: The project ID containing the secret (optional, default todefaultProjectIDordefaultOrganizationID)secretPath: The absolute path to the secret foldersecretName: The name of the secretrevision: The revision to access e.g., "latest_enabled", "1", "2", etc. (optional, defaults tolatest_enabled)targetPath: The relative path where the secret will be mounted (optional, defaults tosecretPath/secretName)
Mount the secrets in your Pod by referencing the SecretProviderClass:
apiVersion: v1
kind: Pod
metadata:
name: test-secret-pod
namespace: default
spec:
containers:
- name: busybox
image: busybox
command: ["sleep", "infinity"]
volumeMounts:
- name: secrets-store
mountPath: "/mnt/secrets"
readOnly: true
volumes:
- name: secrets-store
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: scaleway-provider
nodePublishSecretRef:
name: scaleway-credentialsTo troubleshoot issues with the Scaleway CSI provider, look at logs from the CSI provider pod running on the same node as your application pod:
kubectl get pods -n kube-system -o wide
# Find the Scaleway CSI provider pod running on the same node as your application pod
kubectl logs -n kube-system scaleway-secrets-store-csi-xxxxxTo enable debug mode when installing with Helm, set the provider.debug value to true:
provider:
debug: trueYou can build and deploy the provider on a local cluster. It requires kind, helm and kubectl to be installed. Simply run:
./deploy-local.shExport the generated kubeconfig and access the cluster with kubectl:
export KUBECONFIG="kubeconfig.yaml"
kubectl get pods -o wideIf you are looking for a way to contribute please read the contributing guide.
Participation in the Kubernetes community is governed by the CNCF Code of Conduct.
We love feedback. Feel free to reach us on Scaleway Slack community, we are waiting for you on #secret-manager.