Overview
This article covers how you can quickly get started using Zadara CSI driver for Kubernetes (GKE).
If you are using GKE for your K8S needs, good news is that you have an additional option apart from Google Persistent storage.
The article assumes that the reader has prior experience with Kubernetes and is running a GKE Cluster with VPSA connectivity.
The main objective is to quickly setup a Zadara VPSA as a StorageClass for GKE Cluster using the Zadara CSI driver & helm.
Prerequisites
- GKE Cluster (this article is based on version 1.15.7-gke.23 with three Ubuntu worker nodes).
(*) Important note: GKE Container Optimized OS does not come with an iSCSI client installed and does not allow the installation of it. Hence it is required to use Ubuntu as the image version for the node pools, - Verify that all nodes have open-iscsi installed and a unique IQN defined in
/etc/iscsi/initiatorname.iscsi
- Zadara VPSA deployed in GCP region with connectivity to the relevant GCP project.
- The working client should have Kubectl tools pre-installed and a local Helm client (v2.16.1)
Getting started
- In order to get up and running quickly, it is recommended to clone Zadara's CSI Github repository to your working environment. The repository include all the information required for using the CSI driver, configuration & examples.
Helm & Tiller
- We will deploy the CSI driver using Helm (chart is included in the repository), make sure you have tiller deployed on the GKE cluster.
It is expected to create a service account for tiller along with an appropriate role binding, example:
$ helm init
$ kubectl create serviceaccount --namespace kube-system tiller
$ kubectl create clusterrolebinding tiller-cluster-rule \ --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
$ kubectl patch deploy --namespace kube-system tiller-deploy -p\ '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' - In case you encounter with permissions issue, the GKE service account should be granted with the required API permissions.
Zadara CSI Driver helm chart values
Using Helm for Zadara CSI deployment ease the process significantly. Within the cloned zadara-csi repository, edit the values.yaml (helm/zadara-csi/values.yaml) file using your preferred text editor.
- Set the following parameters according to your environment:
url: the VPSA FQDN or IP
https: use https for secured communication with the VPSA (true/false)
in case IP is set as the url - https connectivity will fail.
token: the VPSA user API token.
provisioner: provisioner is the name of CSI plugin, for use in StorageClass, e.g. us-west.csi.zadara.com on-prem.csi.zadara.com
For the full configuration details, please review https://github.com/zadarastorage/zadara-csi#configuration
Save the file. - Deploy the CSI helm chart by executing:
helm install helm/zadara-csi
- On a successful deployment, the output will include a success message "Successfully installed Zadara-CSI" along with short examples for creating the the StorageClass and PVC.
Save these examples, we will use it. - At this point, the csi controller and node containers should be running in your GKE cluster, we want to make sure the nodes were able to connect to the VPSA as expected. From your VPSA management UI, navigate to the servers section - you should see your GKE nodes added automatically to the list (along with their IP/IQN information)
Create a StorageClass and PVC
- Once node registration is confirmed, we are ready to create our first StorageClass & PVC.
Using the examples below create your StorageClass & PVC
kubectl create -f sc_and_pvc.yaml
Confirm the StorageClass creation -
$ kubectl get sc
Confirm the PVC creation
csi-zadara-calling-tortoise-nas csi-gke-vpsa.zadara.com 3h32m
standard (default) kubernetes.io/gce-pd 8d
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
zadara-calling-tortoise-nas-pvc Bound pvc-0989675a-895e-4812-b309-6f762e4592fe 100Gi RWX csi-zadara-calling-tortoise-nas 3h33m - In the VPSA management UI, you'll be able to see the nas pvc you have just created, by navigating to the Volumes section
At this point you can bind your persistent volume with the application deployment of your choice.
Enjoy!
If you have any question, we love to help, feel free to contact support@zadarastorage.com