StateHub CSI driver
Overview
The StateHub Container Storage Interface (CSI) Driver provides a CSI interface used by Container Orchestrators to manage the lifecycle of states.
CSI Specification Compatibility Matrix
StateHub CSI Driver \ CSI Version |
v1.1.0 |
main branch |
yes |
Features
The following CSI gRPC calls are implemented:
- Controller Service: ListVolumes
- Node Service: NodePublishVolume, NodeUnpublishVolume
StateHub CSI Driver on Kubernetes
Following sections are Kubernetes specific. If you are Kubernetes user, use followings for driver features, installation steps and examples.
Kubernetes Version Compatibility Matrix
StateHub CSI Driver \ Kubernetes Version |
v1.17 |
v1.18 |
main branch |
yes |
yes |
Container Images:
StateHub CSI Driver Version |
Image |
main branch |
statehub/statehub-csi-driver:latest |
Features
- Static Provisioning - create persistence volume (PV) from the state's volume and consume the PV from container using persistence volume claim (PVC).
Prerequisites
- Create a volume on default state
Installation
Deploy driver
Please see the compatibility matrix above before you deploy the driver
If you want to deploy the stable driver without alpha features:
kubectl apply -k "gitlab.com/statehub/statehub-csi/deploy/kubernetes/overlays/stable/?ref=main"
Verify driver is running:
kubectl get pods -n kube-system
Deploy driver with debug mode
To view driver debug logs, run the CSI driver with -v=5
command line option
Development
Please go through CSI Spec and General CSI driver development guideline to get some basic understanding of CSI driver before you start.
Requirements
- Golang 1.15.+
- Docker 17.05+ for releasing
Dependency
Dependencies are managed through go module. To build the project, first turn on go mod using export GO111MODULE=on
, then build the project using: make
Build and Publish Container Image
- Build image and push it with latest tag:
make image && make push
- Build image and push it with release tag:
make image-release && make push-release
Helm and manifests
The helm chart for this project is in the charts/statehub-csi
directory. The manifests for this project are in the deploy/kubernetes
directory. All of the manifests except kustomize patches are generated by running helm template
. This keeps the helm chart and the manifests in sync.
When updating the helm chart:
- Generate manifests:
make generate-kustomize
- There are values files in
deploy/kubernetes/values
used for generating some of the manifests
- When adding a new resource template to the helm chart please update the
generate-kustomize
make target, the deploy/kubernetes/values
files, and the appropriate kustomization.yaml file(s).