GithubHelp home page GithubHelp logo

huntersudo / csi-digitalocean Goto Github PK

View Code? Open in Web Editor NEW

This project forked from resouer/csi-digitalocean

0.0 2.0 0.0 5.38 MB

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

License: Apache License 2.0

Makefile 3.95% Dockerfile 1.07% Go 94.97%

csi-digitalocean's Introduction

csi-digitalocean Build Status

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 Orchestrator's, such as Mesos or Cloud Foundry. Feel free to test it on other CO's and give us a feedback.


The DigitalOcean CSI plugin follows semantic versioning. The current version is: v0.2.0. This means that the project is still under active development and may not be production ready. The plugin will be bumped to v1.0.0 once the DigitalOcean Kubernetes product is released and will continue following the rules below:

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

Installing to Kubernetes


  • Kubernetes v1.10.5 minimum
  • --allow-privileged flag must be set to true for both the API server and the kubelet
  • (if you use Docker) the Docker daemon of the cluster nodes must allow shared mounts

Rancher users:

Mount Propagation is disabled by default on latest v2.0.6 version of Rancher, which prevents the csi-digitalocean to function correctly. To fix the issue temporary, make sure to add the following settings to your cluster configuration YAML file:

      feature-gates: MountPropagation=true

      feature-gates: MountPropagation=true

1. Create a secret with your DigitalOcean API Access Token:

Replace the placeholder string starting with a05... with your own secret and save it as secret.yml:

apiVersion: v1
kind: Secret
  name: digitalocean
  namespace: kube-system
  access-token: "a05dd2f26b9b9ac2asdas__REPLACE_ME____123cb5d1ec17513e06da"

and create the secret using kubectl:

$ kubectl create -f ./secret.yml
secret "digitalocean" created

You should now see the digitalocean secret in the kube-system namespace along with other secrets

$ kubectl -n kube-system get secrets
NAME                  TYPE                                  DATA      AGE
default-token-jskxx   3         18h
digitalocean          Opaque                                1         18h

2. Deploy the CSI plugin and sidecars:

Before you continue, be sure to checkout to a tagged release. Always use the latest stable version For example, to use the latest stable version (v0.2.0) you can execute the following command:

$ kubectl apply -f

This file will be always updated to point to the latest stable release.

A new storage class will be created with the name do-block-storage which is responsible for dynamic provisioning. This is set to "default" for dynamic provisioning. If you're using multiple storage classes you might want to remove the annotation from the csi-storageclass.yaml and re-deploy it. This is based on the recommended mechanism of deploying CSI drivers on Kubernetes

Note that the deployment proposal to Kubernetes is still a work in progress and not all of the written features are implemented. When in doubt, open an issue or ask #sig-storage in Kubernetes Slack

3. Test and verify:

Create a PersistentVolumeClaim. This makes sure a volume is created and provisioned on your behalf:

apiVersion: v1
kind: PersistentVolumeClaim
  name: csi-pvc
  - ReadWriteOnce
      storage: 5Gi
  storageClassName: do-block-storage

Check that a new PersistentVolume is created based on your claim:

$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM             STORAGECLASS       REASON    AGE
pvc-0879b207-9558-11e8-b6b4-5218f75c62b9   5Gi        RWO            Delete           Bound     default/csi-pvc   do-block-storage             3m

The above output means that the CSI plugin successfully created (provisioned) a new Volume on behalf of you. You should be able to see this newly created volume under the Volumes tab in the DigitalOcean UI

The volume is not attached to any node yet. It'll only attached to a node if a workload (i.e: pod) is scheduled to a specific node. Now let us create a Pod that refers to the above volume. When the Pod is created, the volume will be attached, formatted and mounted to the specified Container:

kind: Pod
apiVersion: v1
  name: my-csi-app
    - name: my-frontend
      image: busybox
      - mountPath: "/data"
        name: my-do-volume
      command: [ "sleep", "1000000" ]
    - name: my-do-volume
        claimName: csi-pvc 

Check if the pod is running successfully:

$ kubectl describe pods/my-csi-app

Write inside the app container:

$ kubectl exec -ti my-csi-app /bin/sh
/ # touch /data/hello-world
/ # exit
$ kubectl exec -ti my-csi-app /bin/sh
/ # ls /data



  • Go: min v1.10.x

After making your changes, run the unit tests:

$ make test

If you want to test your changes, create a new image with the version set to dev:

$ VERSION=dev make publish-dev

This will create a binary with version dev and docker image pushed to digitalocean/do-csi-plugin:dev

To run the integration tests run the following:

$ KUBECONFIG=$(pwd)/kubeconfig make test-integration

Release a new version

To release a new version bump first the version:

$ make bump-version

Make sure everything looks good. Create a new branch with all changes:

$ git checkout -b new-release
$ git add .
$ git push origin

After it's merged to master, create a new Github release from master with the version v0.2.0 and then publish a new docker build:

$ git checkout master
$ make publish

This will create a binary with version v0.2.0 and docker image pushed to digitalocean/do-csi-plugin:v0.2.0


At DigitalOcean we value and love our community! If you have any issues or would like to contribute, feel free to open an issue/PR

csi-digitalocean's People


fatih avatar hamidzr avatar nussjustin avatar


 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.