Skip to content

mavimo/csi-driver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  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

About

Kubernetes Container Storage Interface driver for Hetzner Cloud Volumes

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Go 99.6%
  • Other 0.4%