Kubernetes Detailed Setup & Exercises | DevOps Material | VisualPath

Kubernetes Setup

Kubernetes can be set up on a single Linux machine or we can have Master and Nodes on a separate machine. As you would have guessed a single node cluster is good for learning and testing but the production-grade Kubernetes Cluster is required to manage large-scale applications and containers.
We will see both ways of setting up Kuberneter cluster. Setting up all the Kubernetes components manually is a very tedious task but there are few tools in the market that can automate kubernetes cluster deployment for us.

  • Minikube Minikube sets up a single node cluster on a VM running on VirtualBox. We can create and also manage the Kubernetes cluster with minikube. 
  • KOPS Kops sets up a production-grade multinode Kubernetes cluster on AWS cloud, currently, it supports only AWS provider. 

Kubernetes Detailed Setup & Exercises

Minikube setup locally.
What is Minikube?
Minikube runs a single node kubernetes cluster inside a VM on your laptop. It’s for learning and testing kubernetes, should not be used in production.
Setup Minikube
Minikube can be downloaded from its Github repo.
https://github.com/kubernetes/minikube/releases
We are going to setup minikube on a Linux machine so check the latest release URL and download the package. URL mentioned in the screenshot was latest at the time of document preparation.
Virtualbox is the dependency for it, as by default it will create a VM on Virtualbox and setup minikube on it.
setup-minikube-kubernetes
Kubectl
kubectl is a command line interface for running commands against Kubernetes clusters.
Installing and Setting Up kubectl
Check the download page for the latest release url.
Installing and Setting Up kubectl

Kubectl will read the configuration from ~/.kube/config and will know the IP, Port, Auth other details to connect to kubenetes cluster.
Installing and Setting Up kubectl1
Run kubectl command to verify if it’s working.

Installing and Setting Up kubectl2
Try the commands in below screenshot to test if the cluster is working.
Installing and Setting Up kubectl with cluster
 Try the commands in below screenshot to test if the cluster is working.
Installing and Setting Up kubectl with cluster working

That shows our kubernetes cluster is working, we are able to pull images and run a container and also access its service. If you want to stop your cluster you can run minikube stop and it will bring down the minikube cluster.
For more information about Visualpath, visit www.visualpath.in and follow the company on Facebook and Twitter.

Comments