Skip to content

danitso/clouddk-csi-driver

Repository files navigation

Build Status

Kubernetes CSI Driver for Cloud.dk

clouddk-csi-driver is a Kubernetes Container Storage Interface (CSI) Driver for Cloud.dk.

WARNING: This project is under active development and should be considered alpha.

Introduction

The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. Using CSI third-party storage providers can write and deploy plugins exposing new storage systems in Kubernetes without ever having to touch the core Kubernetes code.

Preparation

To use CSI drivers, your Kubernetes cluster must allow privileged pods (i.e. --allow-privileged flag must be set to true for both the API server and the kubelet). This is the default for clusters created with kubeadm.

Installation

Follow these simple steps in order to install the driver:

  1. Ensure that kubectl is configured to reach the cluster

  2. Retrieve the API key from https://my.cloud.dk/account/api-key and encode it

    echo "CLOUDDK_API_KEY: '$(echo "the API key here" | base64 | tr -d '\n')'"
  3. Specify the hardware requirements for the network storage servers

    echo "CLOUDDK_SERVER_MEMORY: '$(echo 4096 | base64 | tr -d '\n')'" \
    && echo "CLOUDDK_SERVER_PROCESSORS: '$(echo 2 | base64 | tr -d '\n')'"
  4. Create a new SSH key pair

    rm -f /tmp/clouddk_ssh_key* \
        && ssh-keygen -b 4096 -t rsa -f /tmp/clouddk_ssh_key -q -N "" \
        && echo "CLOUDDK_SSH_PRIVATE_KEY: '$(cat /tmp/clouddk_ssh_key | base64 | tr -d '\n' | base64 | tr -d '\n')'" \
        && echo "CLOUDDK_SSH_PUBLIC_KEY: '$(cat /tmp/clouddk_ssh_key.pub | base64 | tr -d '\n' | base64 | tr -d '\n')'"
  5. Create a new file called config.yaml with the following contents:

    apiVersion: v1
    kind: Secret
    metadata:
      name: clouddk-csi-driver-config
      namespace: kube-system
    type: Opaque
    data:
      CLOUDDK_API_ENDPOINT: 'aHR0cHM6Ly9hcGkuY2xvdWQuZGsvdjEK'
      CLOUDDK_API_KEY: 'The encoded API key generated in step 2'
      CLOUDDK_SERVER_MEMORY: 'The encoded value generated in step 3'
      CLOUDDK_SERVER_PROCESSORS: 'The encoded value generated in step 3'
      CLOUDDK_SSH_PRIVATE_KEY: 'The encoded private SSH key generated in step 4'
      CLOUDDK_SSH_PUBLIC_KEY: 'The encoded public SSH key generated in step 4'
  6. Create the secret in config.yaml using kubectl

    kubectl apply -f ./config.yaml
  7. Deploy the driver and the sidecars using kubectl

    kubectl apply -f https://raw.githubusercontent.com/danitso/clouddk-csi-driver/master/deployment.yaml
  8. Verify that clouddk-csi-controller and clouddk-csi-node pods are being created and wait for them to reach a Running state

    kubectl get pods -l k8s-app=clouddk-csi-controllers -n kube-system
    kubectl get pods -l k8s-app=clouddk-csi-nodes -n kube-system

Features

PersistentVolume

The clouddk-csi-driver plugin adds support for Persistent Volumes based on NFS. The volumes must be created with the ReadWriteMany capability.

About

Kubernetes CSI Driver for Cloud.dk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published