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

Adding headless service name into serviceName field on operator-managed vmagent statefulset #917

Closed
cglrn opened this issue Apr 3, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@cglrn
Copy link
Contributor

cglrn commented Apr 3, 2024

We want to implement the stream aggregation feature with stream sharding by setting up a 2-layer vmagent structure. For this purpose, within the vmagent CRD that I'm using as a StatefulSet, I can define a headless service giving clusterIP: None in VMAgentSpec.ServiceSpec. However, in order to shard the streams, each pod needs to have DNS records created because I need to shard based on the remotewriteURL of first vmagent layer. For this to happen, the headless service name needs to be set within the StatefulSet as serviceName. Currently, this is not optional, and the serviceName field is set empty, so only headless service record is created and returns all pods' IPs.

@f41gh7 f41gh7 added the enhancement New feature or request label Apr 3, 2024
@f41gh7
Copy link
Collaborator

f41gh7 commented Apr 3, 2024

For me, it's reasonable to change service for vmagent with statefulMode to the headless.

But it requires service recreation, which potentially may disrupt data ingestion. I think, it's acceptable and shouldn't cause long downtime.

@yilmazo
Copy link
Contributor

yilmazo commented Apr 5, 2024

hi @f41gh7,
we created a pull request for this purpose. can you please review when you're available?

@Haleygo
Copy link
Contributor

Haleygo commented Apr 8, 2024

But it requires service recreation, which potentially may disrupt data ingestion. I think, it's acceptable and shouldn't cause long downtime.

@f41gh7 What about creating headless service by default when vmagent is on statefulsetMode, like vmselect and vmstorage? Since headless service provides more feature for statefulset.

@f41gh7
Copy link
Collaborator

f41gh7 commented Apr 10, 2024

But it requires service recreation, which potentially may disrupt data ingestion. I think, it's acceptable and shouldn't cause long downtime.

@f41gh7 What about creating headless service by default when vmagent is on statefulsetMode, like vmselect and vmstorage? Since headless service provides more feature for statefulset.

Good point. I'll implement that.

f41gh7 added a commit that referenced this issue Apr 10, 2024
with useAsDefault: true option, passed to `serviceSpec` definition, it's possible to modify service options.
Mostly, it's needed for `LoadBalancer` configuration or any other platform specific configurations.

 Potentially, it may break some inter-component communication. And should be used with additional care and proper checks.

#904
#917
@f41gh7
Copy link
Collaborator

f41gh7 commented Apr 18, 2024

Must be fixed at v0.43.0 release.

Also, by default, vmagent uses headless service with statefulMode.

@f41gh7 f41gh7 closed this as completed Apr 18, 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

4 participants