NodePort API spec & socat implementation #26
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The API can be used for exposing TCP/UDP ports in the network namespace created along with the user namespace to the host network namespace.
api.sock
is created under therootlesskit --state-dir
directorypkg/api/openapi.yaml
GET /v1/ports
POST /v1/ports
DELETE /v1/ports
rootlessctl
CLI can be used as an API client:rootlessctl list-ports
rootlessctl add-ports
rootlessctl remove-ports
rootlessctl --socket=/path/to/api.sock add-ports 0.0.0.0:8080:80/tcp
Currently, only
socat
implementation is available asrootlesskit --port-driver
.The
slirp4netns
-native implementation is being experimented at rootless-containers/slirp4netns#29 but it does not work with large MTUs at the moment.The code under
pkg/port/socat
package might be also reusable for other projects.Signed-off-by: Akihiro Suda suda.akihiro@lab.ntt.co.jp