Deploy K8s with VAST CSI

Prev Next

Deploy K8S cluster :  

In order to create a K8s cluster, please follow these steps

Prerequisites

Before you begin this tutorial, you’ll need the following:

3 Ubuntu servers :

  • Control Plane/master

  • k8s-node-1

  • k8s-node-2

Step 1 - Set up each server in the cluster to run Kubernetes

On each of the three Ubuntu servers, run the following commands as root. You can type the commands or highlight and copy/paste in the terminal window on the left:

  • Download the Google Cloud public signing key:
    curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

  • Add the Kubernetes apt repository:
    echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

  • sudo swapoff -a    
    sudo sed -i '/ swap / s/^/#/' /etc/fstab
    reboot
  • Edit the Host file on all nodes.

Update apt package index with the new repository and install the utilities:
apt update

apt install -y kubelet=1.24.0-00 kubeadm=1.24.0-00 kubectl=1.24.0-00

  • apt-mark hold kubelet kubeadm kubectl

  • Install Docker:
    export VERSION=19.03 && curl -sSL get.docker.com | sh

  • Kubelet: The primary agent that runs on a Kubernetes node and communicates with the control plane to issue commands to this node and report status

  • Kubeadm: A tool that performs the actions necessary to build up a Kubernetes cluster

  • Kubectl: The command-line tool that lets you control Kubernetes clusters and issue commands to the api-server

  • Docker Engine: A container engine used by Kubernetes to run containers

Make sure to repeat the above steps on k8s-node-1 and k8s-node-2 servers

Cluster Init

On the Control Plane node only, run this command in order to initialize the Kubernetes control plane:

sudo kubeadm init --pod-network-cidr 192.168.0.0/16 --kubernetes-version 1.24.0 --upload-certs

This can take a minute or two to run.

Before we begin using the cluster, we need to configure the kubectl command line tool that let us control the cluster. For configuration, kubectl looks for a file named config in the $HOME/.kube directory.

  • Create the directory:

mkdir -p $HOME/.kube

  • Copy the config file generated by kubeadm to $HOME/.kube/:

cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

  • Change ownership of the file to the current logged in user:

chown $(id -u):$(id -g) $HOME/.kube/config

Your Kubernetes Control Plane has initialized successfully!

Join workers

To join k8s-node-1 and k8s-node-2  as worker nodes to the cluster, we need the token generated by the kubeadm init command.

Run the following command on the Control Plane node:

kubeadm token create --print-join-command

Copy the output and run it on both worker nodes {k8s-node-1 and k8s-node-2}.

  • To check that all nodes are now joined to the Control Plane, run the following command on the Kubernetes Control Plane node:

kubectl get nodes

Installing the Weave Net Add-On

On the Control Plane node, run the kubectl apply command, which will create all the networking resources in the cluster from the supplied manifest file:

kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s-1.11.yaml

Step 2- Deploy VAST CSI Driver

Please follow the procedure: Deploy VAST CSI Driver

DEMO :