kubectl apply -f file.yaml, -f . |
create or update the objects in a file, or in every file of a directory |
kubectl get pods, … -o wide, … -l app=api |
list; with node and IP; only those with a label |
kubectl get all, kubectl get pvc, kubectl get ingress |
the application objects; the volume claims; the Ingresses |
kubectl describe <type> <name> |
one object with its state and events: the first place to look when something is not Running |
kubectl logs <pod>, -f, --previous |
output; followed; of the run before the last restart |
kubectl exec <pod> -- <command>, -it … -- sh |
a command in the container; an interactive shell, if the image has one |
kubectl delete -f file.yaml, kubectl delete pod <name> |
delete what a file describes; one object |
kubectl rollout status / undo deployment/<name> |
follow a rollout; go back one |
kubectl port-forward service/<name> 8080:<port> |
the Service on your machine's port 8080 |
kubectl describe quota, kubectl top pods |
what your namespace reserves; what the pods use now |