Kubernetes Cheatsheet
Here you can find a detailed list of Kubernetes management commands
Kubespray
https://github.com/kubernetes-sigs/kubespray
Kubetail
Bash script that enables you to aggregate (tail/follow) logs from multiple pods into one stream. This is the same as running “kubectl logs -f ” but for multiple pods.
Useful Kubernetes Commands
List All Nodes, Namespace, Containers and networking
kubectl get po –all-namespaces -o=jsonpath=”{range .items[*]}{.spec.nodeName}{‘\t’}{.spec.hostNetwork}{‘\t’}{.metadata.namespace}{‘\t’}{.metadata.name}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.containers..containerPort}{‘\n’}{end}”
List Containers in Pending state
kubectl get po –all-namespaces -o wide | grep Pending
List Nodes and Ports
kubectl get po –all-namespaces -o=jsonpath=”{range .items[*]}{.spec.nodeName}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.containers..containerPort}{‘\n’}{end}”
List Kubernetes Cluster networking setup
kubectl –namespace kube-system get configmap kubeadm-config -o yaml
Generate Join token for additional workers / control-plane in the cluster
kubeadm token create –print-join-command
Schedule Pods on the control plane nodes
kubectl taint nodes –all node-role.kubernetes.io/control-plane- node-role.kubernetes.io/master-
Check All system Events
kubectl get events
Attachment: commands.txt
kubectl describe pod `kubectl get pod -n moshe-sharon | awk '{print $1}'` -n moshe-sharon
We do this for a living.
Kubernetes, DevOps and platform engineering, delivered in days — not another weekend lost to a stack trace.
Start a project →