Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH Remote with kubernetes setup #23

Closed
smarthomeagentur opened this issue Jul 16, 2023 · 1 comment
Closed

SSH Remote with kubernetes setup #23

smarthomeagentur opened this issue Jul 16, 2023 · 1 comment

Comments

@smarthomeagentur
Copy link

Hi,
I tried kubernetes the first time today and got everything running on AWS EKS and HELM Scripts(openbalena, openbalena-admin). I added a device and I also made it to push a image to the device. all this works fine via UI. Btw amazing work, I love it!

now the cherry on top would be if also the remote ssh login would work. at the moment it is kind of connecting via container but it seems not to respond back to browser.
Everything from my routes is https with cert-manager

I already found a lot of help here: #3 but I cant solve my problem

This is the log I get in the remote container:

Waiting for 127.0.0.1:10000.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10001.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10002.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10003.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10004.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10005.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10006.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10007.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10008.[HPM] Proxy created: /  ->
Waiting for 127.0.0.1:10009.
Connected!

Connected!

Connected!

Connected!

Connected!

Connected!

Connected!

Connected!

Connected!

Connected!
Finding next available port using detected active sessions: []
Setting proxy port to: 10000
Executing command: /usr/bin/balena tunnel 2e6d6b4883b808ff940a39d7d0c94b04 -p 22222:127.0.0.1:20002
Waiting for 127.0.0.1:20002.stdout: [Info]    Opening a tunnel to 2e6d6b4883b808ff940a39d7d0c94b04...

stdout: [Info]     - tunnelling 127.0.0.1:20002 to 2e6d6b4883b808ff940a39d7d0c94b04:22222

stdout: [Info]    Waiting for connections...

.
Connected!
Opened VPN tunnel from 127.0.0.1:20002 to remote device 2e6d6b4883b808ff940a39d7d0c94b04:22222 with PID 2035
Scheduling session cleanup for: 2023-07-17T01:33:41.394Z
Redirecting to path: https://remote.openbalena.wirewire.de:10000/ttyd/?arg=20002&arg=2e6d6b4883b808ff940a39d7d0c94b04&arg=balena-unipi&arg=admin&arg=/tmp/aacc9e30-240f-11ee-827a-3ff45f687f72
stdout: [Logs]    :0 => undefined:undefined ===> 2e6d6b4883b808ff940a39d7d0c94b04:22222

In the browser I get a timeout after some time:"No resource with given identifier" But I think from the log it can make the tunnel already but does not seem to respond back to the browser

My OS: Windows WSL2 Ubuntu

openbalena: 3.8.2
kubernetes 1.27

Thanks for your help here if you can find some time to look into this

@smarthomeagentur
Copy link
Author

smarthomeagentur commented Jul 16, 2023

okay it went quick. I found the "issue" because the node script gives back as a response https://remote.openbalena.wirewire.de:10000 what makes no sense with https. so I changed the response string in the .js file and removed the port and now it works in firefox at least
what I changed is
var redirect = req.protocol + "://" + req.headers.host.split(":")[0] + ":" + sessionData.proxyPort;
to
var redirect = req.protocol + "://" + req.headers.host.split(":")[0] ;
Its still not working in chrome but I think the rest of the problems is known with the cookie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants