Skip to content
Kubernetes Container Storage Interface driver for Hetzner Cloud Volumes
Branch: master
Clone or download
Latest commit a8762db Mar 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
deploy/kubernetes Release v1.1.4 Mar 13, 2019
script Add script to update version Mar 13, 2019
src Release v1.1.4 Mar 13, 2019
.travis.yml Test with Go 1.12 Mar 6, 2019
CHANGES.md Release v1.1.4 Mar 13, 2019
Dockerfile
LICENSE Initial commit Dec 20, 2018
README.md Improve docs for base setup (#25) Mar 11, 2019

README.md

Container Storage Interface driver for Hetzner Cloud

Build Status

This is a Container Storage Interface driver for Hetzner Cloud enabling you to use Volumes within Kubernetes. Please note that this driver requires Kubernetes 1.13 or newer.

Getting Started

  1. Make sure that the following feature gates are enabled in your cluster (kubelet and kube-apiserver):

    --feature-gates=CSINodeInfo=true,CSIDriverRegistry=true
    
  2. Create the custom resources CSINodeInfo and CSIDriver as described in the CSI CRDs section in the Kubernetes CSI documentation:

    kubectl apply -f https://raw.githubusercontent.com/kubernetes/csi-api/release-1.13/pkg/crd/manifests/csidriver.yaml
    kubectl apply -f https://raw.githubusercontent.com/kubernetes/csi-api/release-1.13/pkg/crd/manifests/csinodeinfo.yaml
    
  3. Create an API token in the Hetzner Cloud Console.

  4. Create a secret containing the token:

    apiVersion: v1
    kind: Secret
    metadata:
      name: hcloud-csi
      namespace: kube-system
    stringData:
      token: YOURTOKEN
    
  5. Deploy the CSI driver and wait until everything is up and running:

    kubectl apply -f https://raw.githubusercontent.com/hetznercloud/csi-driver/master/deploy/kubernetes/hcloud-csi.yml
    
  6. To verify everything is working, create a persistent volume claim and a pod which uses that volume:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: csi-pvc
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      storageClassName: hcloud-volumes
    ---
    kind: Pod
    apiVersion: v1
    metadata:
      name: my-csi-app
    spec:
      containers:
        - name: my-frontend
          image: busybox
          volumeMounts:
          - mountPath: "/data"
            name: my-csi-volume
          command: [ "sleep", "1000000" ]
      volumes:
        - name: my-csi-volume
          persistentVolumeClaim:
            claimName: csi-pvc
    

    Once the pod is ready, exec a shell and check that your volume is mounted at /data.

License

MIT license

You can’t perform that action at this time.