Openshift connect to Nodes


Userlevel 7
Badge +22

Hi Folks,

I am slowly progressing with my Openshift course and one thing that I find supremely cool is the system they have for connecting to nodes in the cluster. @BertrandFR probably knows this since he works with Openshift :)

 

So instead of using ssh. you can simply run 

oc debug nodes/nodename

and openshift will run a privileged pod on that node which has access to the host file system, then creates a host directory in the root of the container in the pod, so you not only can inspect logs etc but chroot and run programs i.e. 

chroot /host

crictl ps

to see containers running on that node!

Of course the kubelet has to be running on the node so if you are having problems with that.. tough bananas.. back to ssh :)

Simple and highly effective.. no need for ssh!!


5 comments

Userlevel 7
Badge +20

Very cool topic. Will keep an eye on this one.

Userlevel 7
Badge +8

It’s a good reminder @Geoff Burke, thanks!

it’s even a best pratice for Openshift 4 with the introduce of MCO.

It was more with SSH on Openshift 3.

Some link below:

https://github.com/openshift/machine-config-operator

https://cloud.redhat.com/blog/sre-life-helpful-pointers-for-debugging-openshift-1

https://www.redhat.com/sysadmin/how-oc-debug-works

ps: don’t forget to audit this kind of actions and restrict to cluster-administrator :)

 

Userlevel 7
Badge +22

Thanks BertrandFR excellent info!! 

Agree @Geoff Burke - I really like some of the features built into the oc tool. My other favorite is the oc set volumes command. Very useful when working with a stateful application.

Userlevel 7
Badge +22

Agree @Geoff Burke - I really like some of the features built into the oc tool. My other favorite is the oc set volumes command. Very useful when working with a stateful application.

ha. I have not gotten that far in my course yet :), something to look forward to. Thanks

Comment