In CKAD exam I have been asked to SSH to other node in cluster to do some kubectl operations like kubectl get all, though with that getting below:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

Tried doing sudo, but did not work and did check kubectl config view (can see empty file in client node)

How to do this?

1

There are 1 best solutions below

0
On

You need to list the available nodes in the cluster, but first, make sure you're using the correct context:

k get nodes

You will get the available noted like:
node-0 node-1 (to see which one is the worker node, or if you were asked to ssh to a specific node then copy-paste it) should be:

ssh node-0

This is to create some files/directory (ex: to persist data) once you finish return to the master to complete your task.