HyperFlex 4.5 Container Storage Interface (HX-CSI) Installation

In a containerized environment, you need persistent volumes . With HyperFlex 4.5, iSCSI thisis possible. What are the difference between using iSCSI or CSI in a container. Information about Kubernetes Persistent Volumes can be found HERE.

iSCSI can only do: ReadWriteOnce and ReadOnlyMany.
HX-CSI can do both AND also ReadWriteMany. (Block)

There is a very nice installation guide of the HyperFlex CSI, which can be found HERE. I am always learning with hands-on and here is my way of installing the HyperFlex CSI Plugin.

How to configure a Kubernetes cluster can be found HERE.

HyperFlex iSCSI Configuration

Before you can install HX-CSI, HyperFlex iSCSI network must be configured. In the HyperFlex iSCSI Video Serie there is a video with the explanation how it’s working and how to configure it. Please watch those videos before proceeding any further.

Installation of HX-CSI

After the installation of Kubernetes Master, Workers and the HX iSCSI Network Configuration, it is time to install HX-CSI. Download the plugin at www.cisco.com/go/software

Make sure node.session.scan = manual in the /etc/iscsi/iscsid.conf

sudo cat /etc/iscsi/iscsid.conf | grep -i node.session.scan

If it’s not in the file, you will have to put this parameter in the file.
To append this parameter when it’s not in the file:

sudo bash -c 'echo "node.session.scan = manual" >> /etc/iscsi/iscsid.conf'

iscsid.conf is a root owned file and to append the echo command, use bash in the command.

If the parameter is set to auto, you can change it, with verification via the command:

sudo vim -c '%s/node.session.scan = auto/node.session.scan = manual/gc' -c 'wq' /etc/iscsi/iscsid.conf

Enable iscsid and view the status to verify it’s running

sudo systemctl enable iscsid
sudo systemctl status iscsid

Verify if present at the Kubernetes Master Image: –disable-attach-detach-reconcile-sync=true

sudo cat /etc/kubernetes/manifests/kube-controller-manager.yaml | grep -i reconcile

Add it at the command section of the file.

sudo vim /etc/kubernetes/manifests/kube-controller-manager.yaml

Download the HXCSI software from CCO and upload it to the K8S master in the /tmp directory. This can be done via SCP, WinSCP etc.

Extract the image with tar-xf <image name>. New directories will be created.

Copy the HXCSI Image to all workers nodes:

scp ./images/hxcsi-1.2.rel.4.5.1a.569.git.cc5ea579.tar 10.2.12.226:/tmp

Copy all the CSI images to the ALL Kubernetes nodes. I prefer to have those images also been copied to the /tmp of the Master node.

scp ./images/csi* 10.2.12.226:/tmp

On the Kubernetes Worker Nodes, load the HXCSI Image:

sudo docker load – input /tmp/hxcsi-1.2.rel.4.5.1a.569.git.cc5ea579.tar

Now docker load all the other 4 CSI images on ALL kubernetes nodes :

 ls -1 /tmp/csi*.tar | xargs – no-run-if-empty -L 1 sudo docker load -i

HXCSI-Setup

Here are the final steps for the HX-CSI and lets start with the HXCSI-Setup. This file do have a lot of parameters.

/tmp/setup/hxcsi-setup

Usage of ./setup/hxcsi-setup:
-clientId string
Client ID for the Tenant
-cluster-name string
k8s cluster name
-helm-chart
generate helm chart for helm install
-hx-csi-image string
HX csi image for the node plugin (default "smitsh/hxcsi:latest")
-iscsi-url string
hx iscsiUrlurl
-output-dir string
Output directory (default "./hxcsi-deploy/")
-password string
password to hx cluster api
-token string
Service Authentication Token
-url string
hx api url
-username stringcc5ea579
user name to hx cluster api

Depending of your configuration, but here is an example of what I used:

./tmp/setup/hxcsi-setup -clientId IAmJoost -cluster-name jvdmadecluster -hx-csi-image -hx-csi-image hxcsi:1.2.rel.4.5.1a.569.git.cc5ea579 -iscsi-url 10.22.24.13 -url 10.2.12.13 -username admin 

A hxcsi-deploy directory will be created with this content:

Deploy HX-CSI with the command:

kubectl create -f /tmp/hxcsi-deploy/
HX-CSI create
kubectl get pods
K8S command get pods

And that is it! HX-CSI is now installed and can be used.

FREE: Example Directory with Scripts

In the Example Director of the HX-CSI plugin, there are a lot of examples.

HX CSI Example Directory
kubectl create -f /tmp/examples/sample-hxcsi/
Create HX CSI Example
Verify HX CSI Example

Connect to the Containers bash to see how the volume is mount to the container:

kubectl exec -ti test-647b4c8874-l5g5d – /bin/bash

The Persistant Volume is, in this case, mounted on the /usr/mnt/test directory. If you write data to it, delete the container, start a new container and link it to this PVC, you still will see the data.

A WordPress Site with HyperFlex CSI

If you want to have a wordpress running in a container, please have a look at the following post:

https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/


Here are some more HyperFlex / Technical posts:

  • HX-CSI ReadWriteMany Block Device Example
    Specialized applications can need to read/write directly to a block device. The main use case are databases. A filesystem is more “human-readable” and it adds extra overhead. Instead of the filesystem, block devices are chosen more often. More information about Kubernetes can be found HERE. After the installation of Kubernetes and the HyperFlex Container Storage
  • HyperFlex 4.5 Container Storage Interface (HX-CSI) Installation
    In a containerized environment, you need persistent volumes . With HyperFlex 4.5, iSCSI thisis possible. What are the difference between using iSCSI or CSI in a container. Information about Kubernetes Persistent Volumes can be found HERE. iSCSI can only do: ReadWriteOnce and ReadOnlyMany. HX-CSI can do both AND also ReadWriteMany. (Block) There is a very
  • Kubernetes Installation.
    For the HyperFlex Container Storage Interface (HX-CSI) you will need a Kubernetes cluster. Here is the start of an image that have the right software on it and which you can clone before configuring Kubernetes. Start with a normal Ubuntu 18.04 installation. I just want to have certain versions of software and that is why
  • Cutting MP4 Into smaller Files.
    To make some awesome videos, I’m using my GoPro Hero8 with 2K7 (2704×1520) resolution. This is because I’m using a green screen and although the end videos are in FullHD, with this resolution I can easily crop, resize parts of the video without losing any quality. Cutting MP4 into smaller files would make life easier.
  • Restricted Shell in HyperFlex 4.5
    It was already impossible to login with root in HyperFlex Connect, but you still could login with SSH or locally with a root account. In HXDP 4.5 there is the Restricted Shell or Admin Shell. What is the Restricted Shell? In the restricted shell there is a limited number of commands that you can perform.

Leave a Comment