Configure kubernetes pods

Simple steps, where you can easily configure pods and deploy on server/kubernetes cluster.

Configure kubernetes pods in kubeadm cluster:-

  1. To see all available pods namespace in system

kubectl get pods –all-namespaces

  • Run below command to check how many node are running

  kubectl get node

  • Just like docker if we setup a pod in kubernetes, run below command:

                kubectl run nginx –image=nginx

  • Again after deploy or run need to check how may pod are running in system.

                kubectl get pod

                     OR

                 kubectl get pods

  • How to delete deployed image from kubernetes

                  kubectl delete deployment/nginx

  • To check complete description of pods run below command

                 kubectl describe pods

  • More details information about the IP and which cluster node deployed run :

  kubectl get pods -o wide

root@kubmaster:~# kubectl get pods -o wide

NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES

myapp-pod 1/1 Running 0 106m 10.244.1.4 kubnode1

nginx-7cdbd8cdc9-nd9sd 1/1 Running 0 122m 10.244.2.2 kubnode2

  • From that IP we check via curl application is running    

curl <IP Address>  

curl 10.244.2.2

Leave a Reply

Your email address will not be published. Required fields are marked *