Kubernetes is an open source Container Orchestrator for managing, maintaining, monitoring, automating multiple containers in an efficient way.
In this post, i will try to include how to create k8s cluster with minikube and how to interact with clusters with kubectl.
Cluster - a set of computers as nodes working together and perform some task.
Minikube - a command-line tool to create to learn , develop kubernetes, k8s clusters in local environment.
Kubectl - a command-line tool, to interact with the clusters. It is used to deploy, manage, view logs of clusters.
Whether we can use docker container or virtual machine environment. But one is mandatory for creating k8s clusters.
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 sudo install minikube-darwin-amd64 /usr/local/bin/minikube
If you are using windows, Please follow official installation guide provided by Minikube. Check it out
After this, installation in particular operating system.
Let's start our first cluster.
~ minikube start
We'll get this issue, because we don't have permission to write
Let's check the access to the
~ ls -l /var/run/docker.sock
You'll find that root user and user group of docker only have the permission to write.
Let's change user mode in the user group of docker.
~ sudo usermod -aG docker <username> && newgrp docker
After all this, we can start the cluster with minikube.
~ minikube start
🎉 Finally our first cluster is started successfully.
We can check the status of cluster.
~ minikube status
Let's interact with our cluster with kubectl.
~ kubectl get po -A
It will displays all the Pods as in picture below. Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
~ kubectl get nodes
It will display nodes. Nodes are the physical or virtual machine depends on the cluster we use and the purpose of cluster.
Now,We can check the cluster status in minikube dashboard,
~ minikube dashboard
Minikube is a popular tool for learning, developing clusters in development and local environment but it cannot be used in production deployment.
Hope, you get the basic concepts and workflows of kubernetes cluster.