-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Problem Statement
Currently, CRI-O only supports traditional (forward) port forwarding where the
host connects to a port in the container. There are scenarios where it's useful
to have the reverse: a listener in the container that forwards connections back
to the host.
Use Cases
-
Development Workflows: Allow containerized applications to connect to
databases or services running on the developer's host machine without
complex network configuration. -
IDE Debugging: Enable containers to connect back to debugger interfaces
running on the host (e.g., Java remote debugging, Python debugpy). -
Service Mesh Testing: Test service mesh proxies that need to connect to
control plane components on the host. -
CI/CD Pipelines: Allow test containers to access mock services or test
fixtures running on the CI runner.
Proposed Solution
Implement reverse port forwarding that:
- Creates a TCP listener in the container's network namespace
- Waits for the container to connect to localhost:port
- Forwards the connection back to the host stream
- Is controlled via a pod annotation:
io.cri-o.reverse-ports: "8080,9090"