kubectl
tmux setenv NAMESPACE <namespace>
tmux setenv POD1 <pod-1-name>
tmux setenv POD2 <pod-2-name>
tmux setenv POD3 <pod-3-name>
tmux setenv SEC1 <secret-name>
Documentation
https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Namespace
Node
list
Pods
list
kubectl get pods -n $NAMESPACE
kubectl get pods -n $NAMESPACE -o wide
kubectl get pods -n $NAMESPACE -o wide --show-labels
kubectl describe pods $POD1 -n $NAMESPACE
kubectl describe pods $POD2 -n $NAMESPACE
kubectl describe pods $POD3 -n $NAMESPACE
kubectl get pods -n $NAMESPACE -o jsonpath='{range .items[*]}{"\nPod: "}{.metadata.name}{" ==> Containers: "}{range .spec.containers[*]}{.image}{" | "}{end}{end}' | sort
kubectl get pods -n $NAMESPACE -o jsonpath='{range .items[*]}{"\nPod: "}{.metadata.name}{" ==> Containers: "}{range .spec.containers[*]}{.name}{" | "}{end}{end}' | sort
kubectl cp /opt/linux/linux-peas.sh $NAMESPACE/$POD1:/tmp
kubectl cp /opt/linux/linux-priv-checker.sh $NAMESPACE/$POD1:/tmp
kubectl cp /opt/linux/linux-exploit-suggester.sh $NAMESPACE/$POD1:/tmp
kubectl exec --stdin --tty $POD1 -n $NAMESPACE -- /bin/bash
kubectl exec --stdin --tty $POD1 -c <container-name> -n $NAMESPACE -- /bin/bash
Service
Secret
list
details