Skip to content

Instantly share code, notes, and snippets.

@Baargav
Last active April 27, 2018 08:47
Show Gist options
  • Save Baargav/75634acd53d44184a1ad3abc7efd01cb to your computer and use it in GitHub Desktop.
Save Baargav/75634acd53d44184a1ad3abc7efd01cb to your computer and use it in GitHub Desktop.
Useful Kubectl commands

Setting Up kubectl

export KUBECONFIG={cert-file} 
kubectl config use-context {context}

Pods

kubectl get pods
kubectl get pod --all-namespaces --show-all -o wide

DeamonSets

kubectl get ds --namespace=kube-system
kubectl delete ds {ds-name} --namespace=kube-system
kubectl create -f ds.yml

Debugging

This is super useful to debug issues.

kubectl proxy

In a browser, navigate to: localhost:8001/ui

This is a super useful command when you debug. It shows you each pod and the node it sits on:

kubectl get pod --all-namespaces --show-all -o wide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment