I am trying to run kubectl commands on a remote server from local, but seems it is trying to run on localhost when all other commands(ls, date) I am able to run on remote.
command = 'kubectl get pod -n namespace'
stdin,stdout,stderr=ssh.exec_command(command)
Error:
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Any idea how to run kubectl on remote to connect to a pod and run some command there inside the pod?