Minikube & Kubectl -Basic Operations

Minikube & Kubectl will help the developer to create the cluster environment in the local machine and can test the functionality to gain more confidence in the deployment pipeline. Minikube is a one-node cluster environment that contains the master and worker process, which creates a virtual box in the local environment and node runs on top of the virtual box.











Install minkube using the official URL: https://minikube.sigs.k8s.io/docs/start/ follow instructions based on the operating system.

Once done open the command prompt and execute: minikube start.


Kubectl is used to communicate with API server, Master process contains the API server and is the entry point for the Kubernetes.

Will check basic commands to check the status of minikubes 

kubectl get node: will give the node details with the status

minikube status: will give details about the minikube components









* The main advantage of Kubernetes is the replicaSet, Kubernetes will take care of taking the replication of the pods, and pod is the smallest unit in the Kubernetes cluster.

Trying to deploy mongo in Kubernetes and we can make the pod up using the command:


Deployment using the images directly from the DockerHub

kubectl create deployment mongo-dployment --image=mongo



will check that this deployment created the pod ready for business using the command: kubectl get pod




To get the logs of the pod deployment kubectl logs <pod-name>  or to get  structured information

kubectl describe pod  <pod-name>





to get into the interactive terminal can use the same docker syntax like kubectl exec -it <pod-name> bash






Kubernetes used to take care of the replication, we can check this by using kubectl get replicaset





 To scale the pod up and down use the below command 

kubectl scale deployment mongo-dployment --replicas=2 


Pods and Deployments before calling.






Pods and Deployment After scaling







* replicaset is automatically taken care by Kubernetes and it will increase automatically ๐Ÿ˜ฒ





To get equivalent deployment.yaml from use the command:kubectl get deploy mongo-dployment -o yaml














Else generate yaml file using the command : kubectl get deploy mongo-dployment -o yaml >deployment.yaml




This yaml can be used for the deployment, will explain in the below section.

To delete the deployment

to delete the deployment: kubectl delete deployment mongo-dployment




Deployment using Deployment Descriptor (.yaml file) 

We can deploy applications in the Kubernetes using yaml file.

Here we are using the yaml file which we generated in the above section using the command kubectl get deploy mongo-dployment -o yaml >deployment.yaml

It will generate a yaml file in the directory.

Apply this deployment.yaml to create deployment: kubectl apply -f deployment.yaml and check the deployments.









We can scale up or scale down the deployments by editing the replica sections provided in the deployment.yaml file.

*Note: Before do editing reexport the document then make the changes else versioning errors may occur. (kubectl get deploy mongo-dployment -o yaml >deployment.yaml)












Apply the deployment.yaml again to see the changes










We can check the replicaset, kubernetes take care of the calling automatically.







Comments

  1. Even in the 12 months 2020, the solitary zero in European roulette is a defining attribute of the sport. Because of this, the percentages of winning in European roulette are marginally higher than in different recreation variations. Today, one of the fastest-rising games on any iGaming website is online roulette, and more particularly, live ํฌ์ปค์‚ฌ์ดํŠธ online roulette.

    ReplyDelete
  2. One thing’s certain – you’ll by no means find a sport like Bitstarz Billion in Vegas. Regardless, their certified agents handle questions and issues 24 hours a day. Better still, they concern lightning-fast responses that don’t beat around the bush. We obtained an immediate chat reply from a real individual within 5 seconds of ์˜จ๋ผ์ธ ์นด์ง€๋…ธ sending a “test” message. On that note, big-fish hunters in search of big prizes will recognize Ignition’s “Hot Drop” Jackpots. Notably, NeoSurf and crypto depositors will claim an extra 20% bonus.

    ReplyDelete

Post a Comment

Popular posts from this blog

Linux Basics

JAVA 8 Predefined Functions

RabbitMQ