WARNING: This driver is in ALPHA currently. This means that there may be potentially backwards compatability breaking changes moving forward. Do NOT use this drive in a production environment in its current state.
DISCLAIMER: This is not an officially supported Google product
Kubernetes Note: setup-cluster.yaml depends on the existence of cluster-roles system:csi-external-attacher and system:csi-external-provisioner which are in Kubernetes version 1.10.5+
The GCP Compute Persistent Disk CSI Driver is a CSI Specification compliant driver used by Container Orchestrators to manage the lifecycle of Google Compute Engine Persistent Disks.
Status: Alpha
Latest image: gcr.io/google-containers/volume-csi/gcp-compute-persistent-disk-csi-driver:v0.1.0.alpha
This plugin is compatible with CSI versions v0.2.0 and v0.3.0
This plugin can be used as-is beginning with Kubernetes v1.10.5
See Github Issues
Parameter | Values | Default | Description |
---|---|---|---|
"type" | pd-ssd OR pd-standard | pd-standard | Type allows you to choose between standard Persistent Disks or Solid State Drive Persistent Disks |
"replication-type" | none OR regional-pd | none | Replication type allows you to choose between standard zonal Persistent Disks or highly available Regional Persistent Disks |
See Github Issues
This driver supports only one topology key:
com.google.topology/zone
that represents availability by zone.
- [One-time per project] Create GCP service account for the CSI driver and set required roles
$ PROJECT=your-project-here # GCP project
$ GCE_PD_SA_NAME=my-gce-pd-csi-sa # Name of the service account to create
$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to save the service account key
$ ./deploy/setup-project.sh
- Deploy driver to Kubernetes Cluster
$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key
$ GCE_PD_DRIVER_VERSION=stable # Driver version to deploy
$ ./deploy/kubernetes/deploy-driver.sh
- Create example Zonal Storage Class
$ kubectl apply -f ./examples/kubernetes/demo-zonal-sc.yaml
- Create example PVC and Pod
$ kubectl apply -f ./examples/kubernetes/demo-pod.yaml
- Verify PV is created and bound to PVC
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
podpvc Bound pvc-e36abf50-84f3-11e8-8538-42010a800002 10Gi RWO csi-gce-pd 9s
- Verify pod is created and in
RUNNING
state (it may take a few minutes to get to running state)
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
web-server 1/1 Running 0 1m
To build and install a development version of the driver:
$ GCE_PD_CSI_STAGING_IMAGE=gcr.io/path/to/driver/image:dev # Location to push dev image to
$ make push-container
# Modify controller.yaml and node.yaml in ./deploy/kubernetes/dev to use dev image
$ GCE_PD_DRIVER_VERSION=dev
$ ./deploy/kubernetes/deploy-driver.sh
To bring down driver:
$ ./deploy/kubernetes/delete-driver.sh
Running E2E Tests:
$ PROJECT=my-project # GCP Project to run tests in
$ [email protected] # Existing IAM Account with GCE PD CSI Driver Permissions
$ ./test/run-e2e-local.sh
Running Sanity Tests:
$ ./test/run-sanity.sh
Running Unit Tests:
$ ./test/run-unit.sh
Use dep
$ dep ensure
To modify dependencies or versions change ./Gopkg.toml