(managed) k8s node shell

descr

if you are dealing with some cloud’s managed services, you might still need to reach k8s' node shell

define the node you wanna reach

kubectl get nodes | grep ingress

node=...

plan A

https://github.com/kvaps/kubectl-node-shell

kubectl node-shell $node -n kube-node-lease

beware of Kyverno namespace restrictions e.g. [*,kube-system,*][*,kube-public,*][*,kube-node-lease,*]

plan B

https://github.com/KazanExpress/scripts/blob/master/check-confs/nsenter-node.bash

kubectl describe node $node | grep app_type

app_type=ingress

chmod +x nsenter-node.bash
./nsenter-node.bash $node $app_type

ready to go

proceed with your purpose e.g. locate the logs for fluentbit

cd /var/log/pods/
tail -F *ingress-nginx*/controller/0.log | grep -v stderr

resources

https://github.com/luksa/kubectl-plugins

https://github.com/kvaps/kubectl-node-shell

https://stackoverflow.com/questions/48518324/how-to-ssh-into-a-kubernetes-node-or-server

https://alexei-led.github.io/post/k8s_node_shell/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun