The hcloud-csi-driver follows the standard Container Storage Interface (CSI) architecture, split into two distinct deployment models: a Controller and a Node Driver.
1. The Controller
Deployed as a Kubernetes Deployment, the Controller manages cluster-wide volume operations. It consists of the main hcloud-csi-driver container and several sidecar containers (csi-attacher, csi-provisioner, csi-resizer, and liveness-probe).
- Workflow: The sidecars watch the Kubernetes API for events (like
PersistentVolumes or VolumeAttachments). When an event occurs, the sidecars send gRPC requests following the CSI specification to the hcloud-csi-driver container. The driver then communicates with the Hetzner Cloud API via REST to execute operations like creating, attaching, or resizing volumes.
2. The Node Driver
Deployed as a Kubernetes DaemonSet, the Node Driver manages node-specific operations. It consists of the main hcloud-csi-driver container and sidecars (csi-node-driver-registrar and liveness-probe).
- Workflow: The
csi-node-driver-registrar registers the driver with the local kubelet. Once registered, the kubelet communicates directly with the hcloud-csi-driver via a Unix socket to perform node-level tasks such as mounting and unmounting volumes. Unlike the Controller, the Node Driver does not communicate with the Kubernetes API or the Hetzner API directly.