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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s