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.
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.
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
.
Follow these simple steps in order to install the driver:
-
Ensure that
kubectl
is configured to reach the cluster -
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')'"
-
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')'"
-
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')'"
-
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'
-
Create the secret in
config.yaml
usingkubectl
kubectl apply -f ./config.yaml
-
Deploy the driver and the sidecars using
kubectl
kubectl apply -f https://raw.githubusercontent.com/danitso/clouddk-csi-driver/master/deployment.yaml
-
Verify that
clouddk-csi-controller
andclouddk-csi-node
pods are being created and wait for them to reach aRunning
statekubectl get pods -l k8s-app=clouddk-csi-controllers -n kube-system kubectl get pods -l k8s-app=clouddk-csi-nodes -n kube-system
The clouddk-csi-driver
plugin adds support for Persistent Volumes based on NFS. The volumes must be created with the ReadWriteMany
capability.