digitalocean/csi-digitalocean

Go

Open original ↗

Captured source

source ↗
published Apr 11, 2018seen 5dcaptured 8hhttp 200method plain

digitalocean/csi-digitalocean

Description: A Container Storage Interface (CSI) Driver for DigitalOcean Block Storage

Language: Go

License: Apache-2.0

Stars: 599

Forks: 110

Open issues: 38

Created: 2018-04-11T17:39:46Z

Pushed: 2026-06-02T14:21:51Z

Default branch: master

Fork: no

Archived: no

README:

csi-digitalocean

![](https://github.com/digitalocean/csi-digitalocean/workflows/test/badge.svg)

A Container Storage Interface (CSI) Driver for DigitalOcean Block Storage. The CSI plugin allows you to use DigitalOcean Block Storage with your preferred Container Orchestrator.

The DigitalOcean CSI plugin is mostly tested on Kubernetes. Theoretically it should also work on other Container Orchestrators, such as Mesos or Cloud Foundry. Feel free to test it on other CO's and give us a feedback.

Releases

The DigitalOcean CSI plugin follows semantic versioning. The version will be bumped following the rules below:

  • Bug fixes will be released as a PATCH update.
  • New features (such as CSI spec bumps with no breaking changes) will be released as a MINOR update.
  • Significant breaking changes makes a MAJOR update.

Features

Below is a list of functionality implemented by the plugin. In general, CSI features implementing an aspect of the specification are available on any DigitalOcean Kubernetes version for which beta support for the feature is provided.

See also the [project examples](/examples/kubernetes) for use cases.

Volume Expansion

Volumes can be expanded by updating the storage request value of the corresponding PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: csi-pvc
namespace: default
spec:
[...]
resources:
requests:
# The field below can be increased.
storage: 10Gi
[...]

After successful expansion, the _status_ section of the PVC object will reflect the actual volume capacity.

Important notes:

  • Volumes can only be increased in size, not decreased; attempts to do so will lead to an error.
  • Expanding a volume that is larger than the target size will have no effect. The PVC object status section will continue to represent the actual volume capacity.
  • Resizing volumes other than through the PVC object (e.g., the DigitalOcean cloud control panel) is not recommended as this can potentially cause conflicts. Additionally, size updates will not be reflected in the PVC object status section immediately, and the section will eventually show the actual volume capacity.

Raw Block Volume

Volumes can be used in raw block device mode by setting the volumeMode on the corresponding PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: csi-pvc
namespace: default
spec:
[...]
volumeMode: Block

Important notes:

  • If using volume expansion functionality, only expansion of the underlying persistent volume is guaranteed. We do not guarantee to automatically

expand the filesystem if you have formatted the device.

Volume Snapshots

Snapshots can be created and restored through VolumeSnapshot objects.

Note:

Version 1 of the CSI driver supports v1alpha1 Volume Snapshots only.

Version 2 and 3 of the CSI driver supports v1beta1 Volume Snapshots only.

Version 4 and later of the CSI driver support v1 Volume Snapshots only, which is backwards compatible to v1beta1. However, version 3 renders snapshots unusable that had previously been marked as invalid. See the csi-snapshotter documentation on the validating webhook and v1beta1 to v1 upgrade notes.

---

See also [the example](/examples/kubernetes/snapshot).

Volume Statistics

Volume statistics are exposed through the CSI-conformant endpoints. Monitoring systems such as Prometheus can scrape metrics and provide insights into volume usage.

Volume Transfer

Volumes can be transferred across clusters. The exact steps are outlined in [our example](/examples/kubernetes/pod-single-existing-volume).

Installing to Kubernetes

Kubernetes Compatibility

The following table describes the required DigitalOcean CSI driver version per supported Kubernetes release.

| Kubernetes Release | DigitalOcean CSI Driver Version | |--------------------|---------------------------------| | 1.19 | v3 | | 1.20 | v3 | | 1.21 | v3 | | 1.22 | v4 | | 1.23 | v4.2.0+ | | 1.24 | v4.3.0+ | | 1.25 | v4.4.0+ | | 1.26 | v4.5.0+ | | 1.27 | v4.6.0+ | | 1.28 | v4.7.0+ | | 1.29 | v4.8.0+ | | 1.30 | v4.9.0+ | | 1.31 | v4.12.0+ | | 1.32 | v4.13.0+ | | 1.33 | v4.14.0+ | | 1.34 | v4.15.0+ | | 1.35 | v4.16.0+ | | 1.36 | v4.17.0+ | --- Note:

The DigitalOcean Kubernetes product comes with the CSI driver pre-installed and no further steps are required.

---

Driver modes

By default, the driver supports both the controller and node mode. It can manage DigitalOcean Volumes via the cloud API and mount them on the required node. The actually used mode is determined by how the driver is deployed and configured. The suggested release manifests provide separate deployments for controller and node modes, respectively.

When running outside of DigitalOcean droplets, the driver can only function in controller mode. This requires to set the --region flag to a valid DigitalOcean region slug in addition to the other flags.

The --region flag must not be set when running the driver on DigitalOcean droplets.

Alternatively driver can be run in node only mode on DigitalOcean droplets. Driver would only handle node related requests like mount volume. Driver runs in node only mode when --token flag is not provided.

Skip secret creation (section 1. in following deployment instructions) when using node only mode as API token is not required.

| Modes | --token flag | --region flag | |-------------------------------------------|:----------------:|:----------------:| | Controller and Node mode in DigitalOcean |:white_check_mark:| :x: | | Controller only mode not in DigitalOcean |:white_check_mark:|:white_check_mark:| | Node only mode in DigitalOcean | :x: | :x: |

Requirements

  • --allow-privileged flag must be set to true for the API…

Excerpt shown — open the source for the full document.