Miscellaneous

docker 없이 k8s pod에 root 계정으로 접속하기

[혜안] 2023. 5. 19. 17:12
728x90

ContainerID = k -n <Namespace> get pod <Pod> -o jsonpath="{.status.containerStatuses[].containerID}" | sed 's/.*\/\///'

 

pod가 있는 워커노드에서 실행

runc --root /run/containerd/runc/k8s.io/ exec -t -u 0 <ContainerID> sh

 

728x90