Skip to content

Discoverable Alertmanager + fixes + documentation #57

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

Merged
merged 1 commit into from
Oct 18, 2020

Conversation

ts-mini
Copy link
Contributor

@ts-mini ts-mini commented Oct 5, 2020

Just attempting to contribute some of our changes to this chart upstream:

1) We're running multi-tenant - so we wanted to have ingress routes per scopeID when auth is enabled. I've added this under distributor - but I'm not sure if this is the right place (as it ultimately creates a new route pointing to the nginx service)
2) I've added more configuration to the nginx service to make some of the debug/routes easier to hit from ingress.
3) Added a per-scope-id alertmanager path into nginx, configurable to alertmanager.ui.scopeids
4) added documentation
5) adjusted alertmanager discovery
I'm very flexible on implementation details - just interested in getting these style feature set upstream - so let me know if there are stylistic tweaks needed

And added some readme things

@ts-mini ts-mini force-pushed the cortex-chart-tweaks branch 2 times, most recently from be399dd to 68250e1 Compare October 5, 2020 20:36
Copy link
Contributor

@rsteneteg rsteneteg left a comment

Choose a reason for hiding this comment

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

Thanks for your contributions, had a few questions.

Really good start with the chart values in the readme

Comment on lines 77 to 89
{{- $root := . }}
{{- range .Values.alertmanager.ui.scopeIDs }}
{{ $rootScope := . }}
location = /alerts/{{ $rootScope.scopeName }} {
proxy_set_header X-Scope-OrgID {{ $rootScope.scopeID }};
proxy_pass http://{{ template "cortex.fullname" $root }}-alertmanager.{{ $root.Release.Namespace }}.svc.cluster.local:{{ $root.Values.config.server.http_listen_port }}/api/prom/alertmanager/;
}

location ~ /alerts/{{ $rootScope.scopeName }}/(.*) {
proxy_set_header X-Scope-OrgID {{ $rootScope.scopeID }};
proxy_pass http://{{ template "cortex.fullname" $root }}-alertmanager.{{ $root.Release.Namespace }}.svc.cluster.local:{{ $root.Values.config.server.http_listen_port }}/api/prom/alertmanager/$1;
}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are setting the orgID header based on the map, could we add a similar location rule that we have for the other endpoints to the alertmanager ui?

{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
nginx.ingress.kubernetes.io/configuration-snippet: |
Copy link
Contributor

Choose a reason for hiding this comment

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

see my other comment about the map in the nginx config, based on that I don't think we need ingress resources for the distributors.
I would also try to avoid using nginx specific ingress annotations since users may use other ingress controllers.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with both of Roger's items here. We need to keep ingress resource templates agnostic to the kind of controller used, plus in this case, we can use the Nginx config settings which negates the need for another ingress resource.

@ts-mini
Copy link
Contributor Author

ts-mini commented Oct 9, 2020

@rsteneteg I will work on your comments asap! thanks for the feedback

Copy link
Contributor

@khaines khaines 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 @ts-mini for the work here. This PR has a number of changes in it, some of which I think are ready to merge now and others I don't think are a good fit. I'm going to try my best to classify them:

  • Documentation: Huge thank you for creating the values documentation
  • Alertmanger discovery: There's some feedback here, but this is a great addition
  • Nginx tweaks/fixes: Updates for correcting ports, etc ... most welcome
  • Multi-tenancy mapping: See my comment about this being a concern we've wanted to keep external from cortex. I really like your thoughts and approach to this, but I don't think it is a good fit for bringing into the chart.

@ts-mini ts-mini force-pushed the cortex-chart-tweaks branch 4 times, most recently from 161a61d to 72877d5 Compare October 9, 2020 17:48
@ts-mini ts-mini changed the title Discoverable Alertmanager +UI+ other tweaks Discoverable Alertmanager + fixes + documentation Oct 9, 2020
@ts-mini ts-mini requested a review from khaines October 9, 2020 17:48
@ts-mini
Copy link
Contributor Author

ts-mini commented Oct 9, 2020

I've made some changes - stripping out the stuff per @khaines comments. I think this PR is a bit easier to digest now too - seeing as that complexity is gone.

I will work on making a secondary chart for our use that implements the multitenant separately from this chart - this will be a good path forward I think. I understand the implications of disclosing implementation details - but have made this 'additional' chart available for anyone that wants to follow in my footsteps: deploy cortex, then deploy MT setup 'our/my way' - with the standard caveats of course. If there's room in cortexproject for specific implementations - I wouldn't mind having it live here if y'all are ok with it, but that can be a future conversation.

@ts-mini ts-mini force-pushed the cortex-chart-tweaks branch 3 times, most recently from 08eac24 to eb92a62 Compare October 9, 2020 22:21
@rsteneteg
Copy link
Contributor

LGTM

Copy link
Contributor

@khaines khaines left a comment

Choose a reason for hiding this comment

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

Thanks for making the adjustments @ts-mini ! This is a great addition.

LGTM also

@khaines khaines merged commit 96e5c5e into cortexproject:master Oct 18, 2020
@khaines khaines mentioned this pull request Oct 19, 2020
@ts-mini ts-mini deleted the cortex-chart-tweaks branch October 19, 2020 22:58
Skaronator pushed a commit to Skaronator/cortex-helm-chart that referenced this pull request Apr 28, 2021
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.

3 participants