vnijs / kube-ssh

0 stars 0 forks source link

issue with run-app.sh #1

Open ajarv opened 1 year ago

ajarv commented 1 year ago

I tried the run-app.sh script.

All went well until the the step minikube service ssh-app . The way how Kubernetes binds the internal network to the external network interface of the server(s) where kubernetes is running is highly dependent on the kubernetes host .

However I was able to connect to ssh using this ssh -vvv root@localhost -p $(kubectl get svc ssh-app -n default -o=jsonpath='{.spec.ports[0].nodePort}') NOTE I am able to access ssh via localhost because the service is exposed as NodePort type

ajar@libra:~/workspace/zscratch/kube-ssh$ kubectl get svc ssh-app
NAME      TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
ssh-app   NodePort   10.152.183.198   <none>        22:30036/TCP   8m12s
vnijs commented 1 year ago

That gives the below. If I chance the ip to 192.168.49.2 I get the same as before. What made it possible for you to connect to localhost?

❯ ssh -vvv root@localhost -p $(kubectl get svc ssh-app -n default -o=jsonpath='{.spec.ports[0].nodePort}')
OpenSSH_9.3p2, LibreSSL 3.3.6
debug1: Reading configuration data /Users/vnijs/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/vnijs/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/vnijs/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to localhost port 30036.
ssh: connect to host localhost port 30036: Connection refused