Skip to content

Instantly share code, notes, and snippets.

@thekubebuddy
Last active May 10, 2019 04:37
Show Gist options
  • Save thekubebuddy/a99da17da927b5f70d180253c99c14ff to your computer and use it in GitHub Desktop.
Save thekubebuddy/a99da17da927b5f70d180253c99c14ff to your computer and use it in GitHub Desktop.
Most frequently used kubernetes commands

CheetSheet for kubernetes

  1. Getting the kube cluster info
$ kubectl cluster-info 
$ kubectl cluster-info | grep master #(Getting the master node info-IP)
  1. Getting all node-info in a cluster and getting all attributes of nodes
$ kubectl get nodes
$ kubectl describe node <node-name>
  1. Getting deployed pods(full description)/(getting all attributes of pods) in a deployment
$ kubectl describe pod
$ kubectl describe pod pod_name #(can be used for getting the pod IP)
  1. Getting services lists and description
$ kubectl get service #svc
$ kubectl get service | grep service_name
$ kubectl describe svc/<service-name>
  1. Deploying the application after defining .yml file
$ kubectl create -f templates/appConfigFile.yml
$ kubectl delete -f templates/appConfigFile.yml
  1. minikube cmds
$ minikube start
$ minikube start --vm-driver=none #(On EC2)
$ minikube dashboard #(Do not try on EC2 rather try http://127.0.0.1:30000/)
$ minikube stop
$ minikube service web #(displaying the service for our web page)

git@gist.github.com:869085.git

git@github.com:ishaq4466/repoName.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment