Kubernetes Notes : how to create a pod step by step


step1: create a folder 
       folder name: kk
       just create a file 
       index.html (which contains my web content)

step2: create a docker file
       nano Dockerfile
       FROM nginx
       COPY index.html /usr/share/nginx/html


step3: create an image 
       docker build -t kkimage1 .
       my image name:kkimage1

step4: create pod (model-1)
       kubectl run <pod-name> --image <image-name> --port <container port>
       kubectl run kkpod1 --image kkimage1 --port 80

step5: how to display the pods 
       kubectl get pods 
  
step6: how to display the pod IP's
       kubectl get pods -o wide

step7: how to display the total no.of nodes in your cluster
       kubectl get nodes

step8: how to display the node's IP's
       kubectl get nodes -o wide

step9: how to display the complete info of your pod and node
       kubectl describe pod kkpod1

step10: how to delete pod
        kubectl delete pod kkpod1

step11: how to delete image
        docker image rm kkimage1
        

Comments

Popular posts from this blog

Top 10 Git Commands

Kubernetes cluster setup NOTES step by step using minikube

SonarQube Installation & Configuration Step by step