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

mixins: Normalize headless service name for query-frontend/scheduler #8880

Merged

Conversation

JoaoBraveCoding
Copy link
Collaborator

@JoaoBraveCoding JoaoBraveCoding commented Mar 23, 2023

What this PR does / why we need it:
Mixins in general are rather complex pieces of code to consume. When trying to use the loki mixins it wasn't apparent at first that I could use a headless service for DNS SRV discovery for both query_frontend and query_scheduler, especially because for frontend the service is named query_frontend_headless_service and for the scheduler, it's named query_scheduler_service_discovery. Furthermore, the query_frontend mixin provides a non-headless version of the service while query_scheduler doesn't. This PR aims at normalizing this for end users, both headless services are now named query_frontend_headless_service and query_scheduler_headless_service and both also provide a non-headless version of the service.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

@JoaoBraveCoding JoaoBraveCoding requested a review from a team as a code owner March 23, 2023 11:02
@JoaoBraveCoding JoaoBraveCoding force-pushed the normalize-discovery-services branch from 00ba0da to 573570e Compare March 23, 2023 11:03
@dannykopping
Copy link
Contributor

@JoaoBraveCoding please fill in the PR template so we know why these changes are being made.
The "why" is just as important as the "what".

@JoaoBraveCoding
Copy link
Collaborator Author

@dannykopping done, sorry I forgot

@JoaoBraveCoding JoaoBraveCoding force-pushed the normalize-discovery-services branch from 573570e to dd5f1d4 Compare March 23, 2023 11:36
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Thank you @JoaoBraveCoding! I like the initiative here; have you tested this with your setup?

I'm hesitant to approve this though because it's changing the name of a service, which could cause disruption. I think we should hide this name behind a config option, defaulting to query-scheduler-discovery, and allowing folks to override it if they want to.

production/ksonnet/loki/common.libsonnet Outdated Show resolved Hide resolved
@JoaoBraveCoding
Copy link
Collaborator Author

JoaoBraveCoding commented Mar 23, 2023

I'm hesitant to approve this though because it's changing the name of a service, which could cause disruption. I think we should hide this name behind a config option, defaulting to query-scheduler-discovery, and allowing folks to override it if they want to.

Do you mean just the service name (metadata.name) or are you also worried that I've changed the name of the service resource in the mixin? Regarding the first, I am happy to put the name under a config variable defaulting to query-scheduler-discovery

have you tested this with your setup?

Not yet but I don't expect this to break anything since the only actual change was adding a service (the non-headless for scheduler) and modifying the name of a service (query-scheduler-discovery -> query-scheduler-headless)

@dannykopping
Copy link
Contributor

I'm hesitant to approve this though because it's changing the name of a service, which could cause disruption. I think we should hide this name behind a config option, defaulting to query-scheduler-discovery, and allowing folks to override it if they want to.

Do you mean just the service name (metadata.name) or are you also worried that I've changed the name of the service resource in the mixin? Regarding the first, I am happy to put the name under a config variable defaulting to query-scheduler-discovery

Yeah if it changes the way we identify the resource in k8s then I think that's a risk.

@JoaoBraveCoding JoaoBraveCoding force-pushed the normalize-discovery-services branch 3 times, most recently from 90464c7 to 4798de2 Compare March 23, 2023 12:32
@JoaoBraveCoding JoaoBraveCoding changed the title mixins: Normalize headless service name for query-frontend/scheduler WIP: mixins: Normalize headless service name for query-frontend/scheduler Mar 23, 2023
@JoaoBraveCoding JoaoBraveCoding force-pushed the normalize-discovery-services branch from 4798de2 to 2808ae2 Compare March 23, 2023 12:40
@JoaoBraveCoding
Copy link
Collaborator Author

JoaoBraveCoding commented Mar 23, 2023

I've tested the change (thank you @dannykopping for suggesting it 😅 it had some bugs) This PR shows the modifications I had to make to use my version JoaoBraveCoding/observatorium#1 (I ran the make generate cmd to generate the new YAML manifests, no changes) this PR shows a green test CI with the new version observatorium/observatorium#508

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Almost there, thanks for the changes!

production/ksonnet/loki/common.libsonnet Outdated Show resolved Hide resolved
production/ksonnet/loki/query-frontend.libsonnet Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
Problem: Mixins in general are rather complex pieces of code to
consume. When trying to use the loki mixins it wasn't apparent
at first that I could use a headless service for DNS SRV
discovery for both query_frontend and query_scheduler, especially
because for frontend the service is named
query_frontend_headless_service and for the scheduler, it's named
query_scheduler_service_discovery. Furthermore, the query_frontend
mixin provides a non-headless version of the service while
query_scheduler doesn't. This PR aims at normalizing this for end
users, both headless services are now named
query_frontend_headless_service and query_scheduler_headless_service
and both also provide a non-headless version of the service.

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
@JoaoBraveCoding JoaoBraveCoding force-pushed the normalize-discovery-services branch from 2808ae2 to d5f7613 Compare March 23, 2023 13:06
@JoaoBraveCoding JoaoBraveCoding changed the title WIP: mixins: Normalize headless service name for query-frontend/scheduler mixins: Normalize headless service name for query-frontend/scheduler Mar 23, 2023
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM, thank you very much @JoaoBraveCoding!

@dannykopping dannykopping merged commit 1549fec into grafana:main Mar 23, 2023
@JoaoBraveCoding JoaoBraveCoding deleted the normalize-discovery-services branch January 31, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants