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

Add --services flag to start API without using --listen flag #429

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lstocchi
Copy link
Collaborator

In the current implementation when gvproxy is started with the --listen option, it exposes a HTTP API with several endpoints like /connect, /stats, /services ...
The /connect endpoint, however, is only used when the gvforwarder tool is running on the guest, and, when using different connectivities like --listen-vfkit or --listen-qemu, it is not really necessary.

This commit adds a new flag --services that allows to start the HTTP API without the /connect endpoint.

I was not sure how to implement it as I saw 3 possible use cases:

  1. add it as a boolean flag (e.g. --enable-services) and when true creating an endpoint using a defaultURL having a defined http API (the same as --listen, except for the /connect endpoint)
  2. using an array flag (e.g. --api-endpoints) so that the user could specify the endpoint he/she wanted to enable, like --api-endpoints stats, services,connect
  3. the current implementation. A string flag (--services) which works how the other options. The user specify the endpoint and the http api gets started (the same as --listen, except for the /connect endpoint)

I went with the third to stick with the same behavior but open to discuss.

I'll add some test in a follow-up PR as I'd like to leverage the code from #427

Copy link
Contributor

openshift-ci bot commented Nov 22, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lstocchi
Once this PR has been reviewed and has the lgtm label, please assign baude for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

In the current implementation when gvproxy is started with the --listen option, it exposes a HTTP API with several endpoints like /connect, /stats, /services ...
The /connect endpoint, however, is only used when the gvforwarder tool is running on the guest, and, when using different connectivities like --listen-vfkit or --listen-qemu, it is not really necessary.

This commit adds a new flag --services that allows to start the HTTP API without the /connect endpoint. It could be used when using different network connectivity and still wanting a lighter HTTP API. It accepts the endpoint where it will be reachable E.g. gvproxy --listen-vfkit .... --services unix:///tmp/svc_gvproxy.sock

Signed-off-by: Luca Stocchi <[email protected]>
cfergeau added a commit to cfergeau/podman that referenced this pull request Dec 13, 2024
This makes use of the new gvproxy parameter added in
containers/gvisor-tap-vsock#429
cfergeau added a commit to cfergeau/crc that referenced this pull request Dec 18, 2024
At this point, a gvproxy binary built from containers/gvisor-tap-vsock#429
is required. Let's check for it as this requirement is easy to miss.
cfergeau added a commit to cfergeau/crc that referenced this pull request Dec 19, 2024
At this point, a gvproxy binary built from containers/gvisor-tap-vsock#429
is required. Let's check for it as this requirement is easy to miss.
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

Successfully merging this pull request may close these issues.

1 participant