The Google Compute Engine Persistent Disk (GCE PD) Container Storage Interface (CSI) Storage Plugin.
Clone or download
k8s-ci-robot Merge pull request #129 from davidz627/feature/migrationSupport
Support UNSPECIFIED zone and project in volume ID. Static driver name. To prep for migration
Latest commit 69de5c7 Oct 11, 2018

WARNING: This driver is in ALPHA currently. This means that there may be potentially backwards compatability breaking changes moving forward. Do NOT use this driver in a production environment in its current state.

WARNING: The ALPHA driver is NOT compatible with Kubernetes versions 1.12+.

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+

GCP Compute Persistent Disk CSI Driver

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.

Project Status

Status: Alpha Latest image:

CSI Compatibility

This plugin is compatible with CSI versions v0.2.0 and v0.3.0

Kubernetes Compatibility

GCE PD CSI Driver\Kubernetes Version 1.10.5 - 1.11 1.12+
v0.1.0.alpha (stable) yes no
dev no yes

Known Issues

See Github Issues

Plugin Features

CreateVolume Parameters

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

Future Features

See Github Issues


This driver supports only one topology key: that represents availability by zone.

Kubernetes User Guide

Install Driver

  1. [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/
  1. 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/

Zonal Example

  1. Create example Zonal Storage Class
$ kubectl apply -f ./examples/kubernetes/demo-zonal-sc.yaml
  1. Create example PVC and Pod
$ kubectl apply -f ./examples/kubernetes/demo-pod.yaml
  1. 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
  1. 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

Kubernetes Development


To build and install a development version of the driver:

$   # Location to push dev image to
$ make push-container

# Modify controller.yaml and node.yaml in ./deploy/kubernetes/dev to use dev image
$ ./deploy/kubernetes/

To bring down driver:

$ ./deploy/kubernetes/


Running E2E Tests:

$ PROJECT=my-project                               # GCP Project to run tests in
$  # Existing IAM Account with GCE PD CSI Driver Permissions
$ ./test/

Running Sanity Tests:

$ ./test/

Running Unit Tests:

$ ./test/

Dependency Management

Use dep

$ dep ensure

To modify dependencies or versions change ./Gopkg.toml