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

Allow optional entry to /ruler/rule_groups endpoint #476

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexDCraig
Copy link

@AlexDCraig AlexDCraig commented Aug 7, 2023

What this PR does: Allow optional entry into /ruler/rule_groups endpoint via nginx proxy

Which issue(s) this PR fixes:
Fixes #475

Checklist

  • [ x] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@AlexDCraig AlexDCraig force-pushed the dev/enable-ruler-endpoint branch from 1249853 to 48942d1 Compare August 7, 2023 22:42
Signed-off-by: AlexDHoffer <alexdchoffer@gmail.com>
@AlexDCraig AlexDCraig force-pushed the dev/enable-ruler-endpoint branch from 48942d1 to 1125b62 Compare August 7, 2023 22:45
Copy link
Collaborator

@nschad nschad left a comment

Choose a reason for hiding this comment

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

Custom route "injection" is already supported by setting .Values.nginx.config.serverSnippet

I'm inclined to reject this PR on the basis that this would just add more spaghetti templating

@AlexDCraig
Copy link
Author

The custom route injection for this is kind of hideous:

nginx:
  config:
    serverSnippet:
      location ~ /ruler/rule_groups {
          proxy_pass      http://{{ template "cortex.fullname" . }}-ruler.{{ printf "%s.svc.%s:%d" .Release.Namespace .Values.clusterDomain (.Values.config.server.http_listen_port | int) }}$request_uri;
      }

Or is there a way to call that $rootDomain function the other routes use from the values file?

@nschad
Copy link
Collaborator

nschad commented Aug 9, 2023

The custom route injection for this is kind of hideous:

nginx:
  config:
    serverSnippet:
      location ~ /ruler/rule_groups {
          proxy_pass      http://{{ template "cortex.fullname" . }}-ruler.{{ printf "%s.svc.%s:%d" .Release.Namespace .Values.clusterDomain (.Values.config.server.http_listen_port | int) }}$request_uri;
      }

Or is there a way to call that $rootDomain function the other routes use from the values file?

I don't know, have you tried setting $rootDomain? I assume the context might be different

@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2023
Copy link
Collaborator

@nschad nschad left a comment

Choose a reason for hiding this comment

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

To be honest I can't really follow my reasoning before as to why this not worth doing.

We can definitely get this in.

@@ -722,6 +722,8 @@ ruler:
enabled: true
readOnlyRootFilesystem: true

list_all_rule_groups_api: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this under nginx.config? Considering that the docs say it's not part of the ruler api, this should be a bit better suited there. Also might I suggest a rename to something like exposeRulerRulesAPIEndpoint ?

Whatever you choose please no snake_case. You can also add a doc string

@stale stale bot removed the stale label Dec 16, 2023
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.

Optionally expose Ruler rules endpoint in nginx ingress
2 participants