Skip to content
Snippets Groups Projects
Select Git revision
  • 61e097d43064323b2a484f03b677601b9adf85ab
  • master default protected
  • fix/blockmode-expansion-test
  • fix/blockmode-expansion
  • use-official-metadata-endpoint
  • versioning-policy
  • v1.5.3
  • v1.5.2
  • v1.5.1
  • v1.5.0
  • v1.4.0
  • v1.3.2
  • v1.3.1
  • v1.3.0
  • v1.2.3
  • v1.2.2
  • v1.2.1
  • v1.2.0
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
25 results

csi-driver

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Thomas Cyron authored and GitHub committed
    From the CSI spec about using the gRPC `aborted` error code:
    
    > [...] MAY return this error code to reject secondary calls.
    
    That's exactly the opposite of what we want. We want calls to be
    retried when the call failed because the server is locked.
    61e097d4
    History

    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

      Also make sure that privileged pods are allowed in your cluster (kubelet and kube-apiserver):

      --allow-privileged=true

      See Enabling features and Enable privileged Pods in the Kubernetes CSI documentation.

    2. Create the CSINodeInfo resource:

      kubectl create -f https://raw.githubusercontent.com/kubernetes/csi-api/master/pkg/crd/manifests/csinodeinfo.yaml

      See Enabling CSINodeInfo 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