Skip to content

fix: update vmselect/vminsert service selector when RequestsLoadBalancer is set#1829

Open
vrutkovs wants to merge 1 commit intomasterfrom
vmcluster-vmauth-lb
Open

fix: update vmselect/vminsert service selector when RequestsLoadBalancer is set#1829
vrutkovs wants to merge 1 commit intomasterfrom
vmcluster-vmauth-lb

Conversation

@vrutkovs
Copy link
Collaborator

@vrutkovs vrutkovs commented Feb 19, 2026

Make sure that RequestsLoadBalancer setting changes labels and selector of vminsert/vmselect internal services and points to lb instead of vmselect/vminsert services directly

Fixes #1814


Summary by cubic

Update vmselect and vminsert internal services to route through the vmauth RequestsLoadBalancer when enabled. This ensures traffic goes via the LB instead of directly to vmselect/vminsert pods.

  • Bug Fixes
    • Set Service.Spec.Selector to the balancer (ClusterComponentBalancer) for vmselect and vminsert when RequestsLoadBalancer is enabled.
    • Added tests covering both insert and select services to verify selector and label updates.

Written for commit 3e4808f. Summary will update on new commits.

…cer is set

Make sure that RequestsLoadBalancer setting changes labels and selector of vminsert/vmselect
internal services and points to lb instead of vmselect/vminsert services directly
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

}
})
if cr.Spec.RequestsLoadBalancer.Enabled && !cr.Spec.RequestsLoadBalancer.DisableInsertBalancing {
svc.Name = cr.PrefixedInternalName(vmv1beta1.ClusterComponentInsert)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when requests load balancer enabled this service has a different name and vmauth uses it to query insert instances, same is for select, with this change vmauth will be querying itself

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this changes the internal VMInsert / VMSelect service, which is already pointing to VMInsert / VMInsert. But aren't we creating a new service for LB (in createOrUpdateLBProxyService?) and we should be pointing "external" service to it as well - I can't find the place where this happens

Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when requestsloadbalancer is enabled createOrUpdateLBProxyService creates "external" vminsert/vmselect services that target vmauth with the same name as buildVMSelectService/buildVMInsertService create, when requestsLoadBalancer is disabled

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. In that case, #1814 is probably an invalid issue - I'll doublecheck vmauth metrics to see if the traffic is flowing throuigh them correctly

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.

VMDistributed: point to vmauth when requestsLoadBalancer is enabled

2 participants