Kubernetes
Astuces
Accès root
Si un pod n'a pas d'accès root, il est possible d'obtenir un accès root en se connectant en mode debug sur le pod en question.
# Access root
kubectl -n <namespace> debug <nom-du-pod> -it --image=ubuntu [--target=<conteneur>] --profile=sysadmin -- /bin/bash
# debug process
apt update && apt install -y ltrace strace procps pstack
strace/ltrace -p <PID> -t -f -s 200
# Debug binaire linux
apt update && apt install -y pstack
# Debug python
python -m venv .venv
pip install py-spy
py-spy dump|top --pid <PID>