How kubernetes-sigs/secrets-store-csi-driver works
Project type and purpose
• This is a Kubernetes extension: the “Secrets Store CSI Driver.” It consists of a set of CRDs, controllers, and a CSI volume‐plugin that lets you mount external secrets stores (e.g. Azure Key Vault, AWS Secrets Manager, Vault) into pods.
File structure and map out high‐level components
• apis/v1 & apis/v1alpha1: CRD type definitions for SecretProviderClass and SecretProviderClassPodStatus
• controllers/… : Kubernetes controllers (operator pattern)
• secretproviderclasspodstatus_controller
• syncsecret controller (sync CSI‐mounted secrets back to native K8s Secrets)
• tokenrequest controller (manage token refresh for external stores)
• cmd/secrets-store-csi-driver/main.go: entrypoint for the CSI driver binary
• pkg/secrets-store: CSI sidecar gRPC servers
• identityserver (NodeGetInfo, Probe)
• nodeserver (NodePublishVolume, NodeUnpublishVolume)
• controllerserver (ControllerPublish/Unpublish, CreateVolume, DeleteVolume)
• provider/: gRPC plugin interface (service.proto) and provider implementations
• charts/, deploy/, config/: Helm charts and raw YAML for installing the driver
• pkg/client, pkg/k8s, pkg/util, pkg/metrics, pkg/rotation: shared libraries for client‐go, token management, metrics, secret rotation
README for additional architectural insights
• CSI Inline volume integration
• SecretProviderClass CRD → instructs the CSI driver which provider and objects to fetch
• Sidecar & driver run in the same pod on each node
• Controllers run in a Deployment in the control plane