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

Port forward fails, if running in a container. #169

Open
4 tasks
kmdkuk opened this issue Oct 14, 2022 · 0 comments
Open
4 tasks

Port forward fails, if running in a container. #169

kmdkuk opened this issue Oct 14, 2022 · 0 comments

Comments

@kmdkuk
Copy link
Contributor

kmdkuk commented Oct 14, 2022

What

Port forward fails, if running in a container.
The following error message is output.

$ sudo pmctl2 forward add 4000 operation:10.72.48.0:4000
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to create bus connection: Host is down
2022-07-04T04:23:02.576480Z kmdkuk-dctest pmctl2 error: "exit status 1"

It is probably due to the use of systemd-run for port forwarding.

c := exec.CommandContext(ctx,
"systemd-run",
fmt.Sprintf("--unit=pmctl-forward-%d.service", forward.LocalPort),
fmt.Sprintf("--description=%s", forwardJSON),
"socat",
fmt.Sprintf("tcp-listen:%d,fork,reuseaddr", forward.LocalPort),
fmt.Sprintf("exec:ip netns exec %s socat STDIO tcp-connect\\:%s\\:%d,nofork",
forward.PodName, forward.RemoteHost, forward.RemotePort))

How

If you want to use it in container, executesocat using a sidecar.

Checklist

  • Finish implentation of the issue
  • Test all functions
  • Have enough logs to trace activities
  • Notify developers of necessary actions
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

1 participant