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 vmauth as HTTP LoadBalancer option for VMCluster #1130

Closed
f41gh7 opened this issue Oct 21, 2024 · 2 comments
Closed

Add vmauth as HTTP LoadBalancer option for VMCluster #1130

f41gh7 opened this issue Oct 21, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@f41gh7
Copy link
Collaborator

f41gh7 commented Oct 21, 2024

Currently, traffic to vmselect and vminsert components are routed via Kubernetes Service. It provides a connection based access model to the endpoint components behind it. Since It's a common practice for client applications to re-use established, it's most like that request traffic will be distributed unevenly between application replicas. It makes resources usage less efficient.

There are multiple ways to mitigate this issue. One of the most straightforward ways to mitigate it - enable client side load-balancing via Service-Mesh mechanism. But it's external component, that requires to be installed by kubernetes cluster administrators. It's out of the scope of operator to do that. We can only provide a recommendation at documentation for it.

It brings us to the second option - use http load-balacing proxy in front of vmselect/vminsert. And it's a good task for vmauth.

Proposed solution:

  • create vmauthBalacing spec definition at VMCluster.
  • it must have enabled boolean flag.
  • when enabled it must create additional deployment with vmauth component.
  • it must include common application options - such as version, replicas, resources, deployment configuration options.
  • vmauth config must have unauthorized section with routing to vmselect/vminsert by prefix.
  • operator must update vmselect and vminsert services to point to the vmauth instead of vminsert/vmselect components
  • it's also required to create additional services for vmauth -> vminsert/vmselect communication
  • enabling/disabling load-balancing option should be without downtime.
@f41gh7 f41gh7 added the enhancement New feature or request label Oct 21, 2024
@f41gh7 f41gh7 self-assigned this Oct 21, 2024
f41gh7 added a commit that referenced this issue Oct 30, 2024
 It allows to properly load-balance clients requests to the vmselect and
vminsert componets. And utilise CPU usage evenly.

 It create additional services and update exist vminsert and vmselect
service to point to the vmauth deployment.

 vmauth deployment uses unauthorized config and vmauth srv
service-discovery mechanism for pod discovery.

 Operator also applies all user defined service modification to the
internal services.

 An addiional note, it's required to update multi-level clusters setup.
Since cluster related ports will be only exposed at internal services.
Since vmauth cannot route tcp requests.

related issue: #1130

Signed-off-by: f41gh7 <[email protected]>
@f41gh7
Copy link
Collaborator Author

f41gh7 commented Oct 30, 2024

vmcluster_with_balancer

network scheme for the new topology with vmauth deployment.

f41gh7 added a commit that referenced this issue Oct 31, 2024
 It allows to properly load-balance clients requests to the vmselect and
vminsert componets. And utilise CPU usage evenly.

 It create additional services and update exist vminsert and vmselect
service to point to the vmauth deployment.

 vmauth deployment uses unauthorized config and vmauth srv
service-discovery mechanism for pod discovery.

 Operator also applies all user defined service modification to the
internal services.

 An addiional note, it's required to update multi-level clusters setup.
Since cluster related ports will be only exposed at internal services.
Since vmauth cannot route tcp requests.

related issue: #1130

Signed-off-by: f41gh7 <[email protected]>
f41gh7 added a commit that referenced this issue Oct 31, 2024
 It allows to properly load-balance clients requests to the vmselect and
vminsert componets. And utilise CPU usage evenly.

 It create additional services and update exist vminsert and vmselect
service to point to the vmauth deployment.

 vmauth deployment uses unauthorized config and vmauth srv
service-discovery mechanism for pod discovery.

 Operator also applies all user defined service modification to the
internal services.

 An addiional note, it's required to update multi-level clusters setup.
Since cluster related ports will be only exposed at internal services.
Since vmauth cannot route tcp requests.

related issue: #1130

Signed-off-by: f41gh7 <[email protected]>
f41gh7 added a commit that referenced this issue Oct 31, 2024
 It allows to properly load-balance clients requests to the vmselect and
vminsert componets. And utilise CPU usage evenly.

 It create additional services and update exist vminsert and vmselect
service to point to the vmauth deployment.

 vmauth deployment uses unauthorized config and vmauth srv
service-discovery mechanism for pod discovery.

 Operator also applies all user defined service modification to the
internal services.

 An addiional note, it's required to update multi-level clusters setup.
Since cluster related ports will be only exposed at internal services.
Since vmauth cannot route tcp requests.

related issue: #1130

Signed-off-by: f41gh7 <[email protected]>
@f41gh7 f41gh7 added the waiting for release The change was merged to upstream, but wasn't released yet. label Oct 31, 2024
f41gh7 added a commit that referenced this issue Oct 31, 2024
 It allows to properly load-balance clients requests to the vmselect and
vminsert componets. And utilise CPU usage evenly.

 It create additional services and update exist vminsert and vmselect
service to point to the vmauth deployment.

 vmauth deployment uses unauthorized config and vmauth srv
service-discovery mechanism for pod discovery.

 Operator also applies all user defined service modification to the
internal services.

 An addiional note, it's required to update multi-level clusters setup.
Since cluster related ports will be only exposed at internal services.
Since vmauth cannot route tcp requests.

related issue: #1130

Signed-off-by: f41gh7 <[email protected]>
f41gh7 added a commit that referenced this issue Oct 31, 2024
 It allows to properly load-balance clients requests to the vmselect and
vminsert componets. And utilise CPU usage evenly.

 It create additional services and update exist vminsert and vmselect
service to point to the vmauth deployment.

 vmauth deployment uses unauthorized config and vmauth srv
service-discovery mechanism for pod discovery.

 Operator also applies all user defined service modification to the
internal services.

 An addiional note, it's required to update multi-level clusters setup.
Since cluster related ports will be only exposed at internal services.
Since vmauth cannot route tcp requests.

related issue: #1130

Signed-off-by: f41gh7 <[email protected]>
@f41gh7
Copy link
Collaborator Author

f41gh7 commented Nov 6, 2024

Feature included to the v0.49.0 release

@f41gh7 f41gh7 closed this as completed Nov 6, 2024
@hagen1778 hagen1778 removed the waiting for release The change was merged to upstream, but wasn't released yet. label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants