What is Minikube?

What is kubectl?

It’s the command line tool to interact with Minikube cluster or Cloud cluster

Main kubectl commands

  • kubectl get nodes
  • kubectl get pods
  • kubectl get services

Create Deployment - abstraction of Pod

  • kubectl create deployment nginx-depl --image=nginx
  • kubectl get deployment
  • kubectl get pod
  • kubectl get replicaset

  • ReplicaSet is a layer between Deployment and Pod

Edit Deployment

  • kubectl edit deployment nginx-depl
  • kubectl get pod
  • kubectl get replicaset

Debug

kubectl logs [pod-name]

Login to terminal of the Pod

  • kubectl exec -it [pod-name] -- bin/bash
  • ls
  • exit

Delete Deployment (Pod)

  • kubectl delete deployment mongo-depl

Apply the config file

  • kubectl apply -f [filename]