Kubectl cheatsheet


kubectl get pods    #list pods

kubectl describe pod <pod-name>   # get pod details

kubectl expose pod <pod> --port = 4444 --name=frontend   #expose port of a pod, creates new service

kubectl port-forward <pod-name> 8080  # port forward the exposed pod port to your local machine

kubectl attach <pod-name> -i   #attach to pod

kubectl exec <pod-name> mylabel=awesome   #labelling

kubectl run -i -tty busybox --image=busybox --restart=never --sh  #run shell in a pod

Advertisements
Kubectl cheatsheet