siderolabs / omni

SaaS-simple deployment of Kubernetes - on your own hardware.
Other
525 stars 31 forks source link

feat: allow setting some url params for api endpoint #210

Closed Simon-Boyer closed 4 months ago

Simon-Boyer commented 5 months ago

feat: Accept apiendpoint url params

Description

This lets the operator define url params for the api endpoint. For example https:///?grpc_tunnel=true. Instead of only appending the jointoken, we are parsing the url and adding it using Query.Set.

Why

When configuring an ingress in front of omni, it is easier to use the grpc tunnel instead of opening an UDP port. But there is currently no way of setting grpc_tunnel to true by default. This change has a minimal effect on how the endpoint is handled while allowing an operator to set default param values.

Unix4ever commented 5 months ago

I would rather suggest to add another flag to the command flags. See cmd/omni/main.go. Can add the new flag there and read it into config.go module.

If it's set then enable HTTP tunnel mode in the manager.go

Simon-Boyer commented 4 months ago

@Unix4ever shouldnt it be "siderolink-use-grpc-tunnel" instead of "siderolink-use-http-tunnel"? We might be able to use grpc over https but the name of the functionnality is grpc_tunnel, would be more consistent. Other than that looks good, wasnt able to work on this in past 2 days so thank you!

Unix4ever commented 4 months ago

yeah, sure, makes sense :) No problem. It's a small change to make

Unix4ever commented 4 months ago

/m