-
Notifications
You must be signed in to change notification settings - Fork 258
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 OSS Configuration to Serve from Subpath #4302
Comments
The current version of Grafana OnCall, at the time this issue was opened, is v1.4.4. If your issue pertains to an older version of Grafana OnCall, please be sure to list it in the PR description. Thank you 😄! |
This should be configurable by setting the BASE_URL environment variable |
Hi @mderynck - If deploying via Helm, would this be env.BASE_URL or the top-level base_url value? I was not able to accomplish this using the top-level field. |
@mderynck Unfortunately, this doesn't work. I deploy my oncall-engine with this env variable:
This is my Ingress: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: grafana-oncall
annotations:
traefik.ingress.kubernetes.io/router.tls: "true"
traefik.ingress.kubernetes.io/router.entrypoints: websecure
spec:
rules:
- host: oncall.mycompany.de
http:
paths:
- pathType: Prefix
path: "/oncall"
backend:
service:
name: oncall-engine
port:
number: 8080
- pathType: Prefix
path: "/"
backend:
service:
name: grafana
port:
number: 8080 When I request something from
|
You can workaround this via path rewriting at ingress level: Oncall configuration: BASE_URL=https://oncall.mycompany.de/oncall Ingress with path-rewriting (using Traefik middleware, but works similarly with Nginx regex-replace): apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: oncall-stripprefix
namespace: oncall
spec:
stripPrefix:
prefixes:
- /oncall
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: grafana-oncall
namespace: oncall
annotations:
traefik.ingress.kubernetes.io/router.tls: "true"
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: oncall-oncall-stripprefix@kubernetescrd
spec:
rules:
- host: oncall.mycompany.de
http:
paths:
- pathType: Prefix
path: "/oncall"
backend:
service:
name: oncall-engine
port:
number: 8080
- pathType: Prefix
path: "/"
backend:
service:
name: grafana
port:
number: 8080 Everything seems to work fine with this. I could even connect the Oncall mobile app to this instance by scanning the QR code. Integrations also seem to work fine, including their advertised URLs in Grafana UI. Seeing that Grafana-Cloud serves the Oncall-API on |
BASE_URL controls what the engine says the URL is when populating various responses. It does not change actual paths or routing, oncall engine is using uwsgi to serve the django app at /. As @ChristianCiach has shown path prefix is accomplished through a separate application proxy. |
What would you like to see!
At the moment, it seems to be impossible to serve OnCall from a subpath in OSS deployments. Grafana Cloud serves OnCall from /oncall, but there's no option to specify this in any config file.
Applying a similar approach to grafana/grafana, allowing a serve_from_subpath configuration in the config and exposing this as a value in the Helm chart would be incredibly useful.
For context, the lack of this feature completely breaks hooking up a Grafana instance with an OnCall instance when trying to serve them from the same domain. Grafana wants to route to /integrations from the root of the domain, but we serve OnCall from /oncall, meaning Grafana would need to route to /oncall/integrations (like Grafana Cloud). Therefore, the only way to integrate Grafana and OnCall in this same-domain Enterprise setup is by serving OnCall behind a reverse proxy and integrating it with Grafana via the Webhook integration.
Product Area
Other
Anything else to add?
No response
The text was updated successfully, but these errors were encountered: