(basic / usefull ) kubectl commands

Disclaimer: This is a list of commands/options I found most useful in my day-to-day activities, there are many commands/options available, you may find other commands/options more useful or use them in another way.

kubectl config get-contexts
kubectl config use-context <context>
kubectl config view

kubectl get pods
kubectl get services --all-namespaces
kubectl get namespaces
kubectl get deployments --namespace <namespace>

kubectl logs <pod name> 
kubectl describe pods <pod name>

kubectl exec -it <pod name> -- /bin/bash
kubectl describe secret <secret name>
kubectl delete pod <pod name> --force --grace-period=0
kubectl run -i -tty busybox --image=busybox -restart=Never -- sh
This entry was posted in devops, kubernetes, Tools. Bookmark the permalink.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.