Skip to content

Commit 4fec213

Browse files
committed
fix: 🐛 add reverse proxy for observatorium bug workaround
1 parent 591e83e commit 4fec213

File tree

6 files changed

+96
-2
lines changed

6 files changed

+96
-2
lines changed

charts/observatorium/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This Helm chart deploy Observatorium API and help to manage tenant
44

55
type: application
66

7-
version: 0.5.2
7+
version: 0.5.3
88

99
appVersion: "main-2025-02-10-1bcf722"
1010

charts/observatorium/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# observatorium
22

3-
![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: main-2025-02-10-1bcf722](https://img.shields.io/badge/AppVersion-main--2025--02--10--1bcf722-informational?style=flat-square)
3+
![Version: 0.5.3](https://img.shields.io/badge/Version-0.5.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: main-2025-02-10-1bcf722](https://img.shields.io/badge/AppVersion-main--2025--02--10--1bcf722-informational?style=flat-square)
44

55
This Helm chart deploy Observatorium API and help to manage tenant from values file.
66

@@ -62,6 +62,10 @@ This Helm chart deploy Observatorium API and help to manage tenant from values f
6262
| rate_limiter.enabled | bool | `false` | |
6363
| replicaCount | int | `1` | |
6464
| resources | object | `{}` | |
65+
| reverseProxy.enabled | bool | `false` | Enables or disables the reverse proxy component. |
66+
| reverseProxy.image | string | `"nginxinc/nginx-unprivileged:1.28-alpine"` | Container image used for the reverse proxy (default: non-root NGINX image). |
67+
| reverseProxy.logsHost | string | `""` | Hostname of the logs backend to which requests should be proxied. |
68+
| reverseProxy.metricsHost | string | `""` | Hostname of the metrics backend to which requests should be proxied. |
6569
| securityContext | object | `{}` | |
6670
| service.port | int | `80` | |
6771
| service.type | string | `"ClusterIP"` | |
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.reverseProxy.enabled -}}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
labels:
6+
{{- include "observatorium.labels" (dict "ctx" $ "component" "nginx" ) | nindent 4 }}
7+
name: {{ include "observatorium.resourceName" (dict "ctx" $ "component" "nginx") }}
8+
data:
9+
nginx.conf: |
10+
events {}
11+
http {
12+
server {
13+
listen 8080;
14+
15+
location /loki/ {
16+
proxy_pass http://{{ .Values.reverseProxy.logsHost }}/;
17+
proxy_set_header Host {{ .Values.reverseProxy.logsHost }};
18+
proxy_ssl_server_name on;
19+
}
20+
21+
location /mimir/ {
22+
proxy_pass http://{{ .Values.reverseProxy.metricsHost }}/;
23+
proxy_set_header Host {{ .Values.reverseProxy.metricsHost }};
24+
proxy_ssl_server_name on;
25+
}
26+
}
27+
}
28+
{{- end }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{{- if .Values.reverseProxy.enabled -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
labels:
6+
{{- include "observatorium.labels" (dict "ctx" $ "component" "nginx" ) | nindent 4 }}
7+
name: {{ include "observatorium.resourceName" (dict "ctx" $ "component" "nginx") }}
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
{{- include "observatorium.selectorLabels" (dict "ctx" $ "component" "nginx") | nindent 6 }}
13+
template:
14+
metadata:
15+
labels:
16+
{{- include "observatorium.selectorLabels" (dict "ctx" $ "component" "nginx") | nindent 8 }}
17+
spec:
18+
containers:
19+
- name: nginx
20+
image: {{ .Values.reverseProxy.image }}
21+
ports:
22+
- containerPort: 8080
23+
volumeMounts:
24+
- name: config
25+
mountPath: /etc/nginx/nginx.conf
26+
subPath: nginx.conf
27+
- name: run
28+
mountPath: /run
29+
volumes:
30+
- name: config
31+
configMap:
32+
name: {{ include "observatorium.resourceName" (dict "ctx" $ "component" "nginx") }}
33+
- name: run
34+
emptyDir: {}
35+
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.reverseProxy.enabled -}}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
labels:
6+
{{- include "observatorium.labels" (dict "ctx" $ "component" "nginx" ) | nindent 4 }}
7+
name: {{ include "observatorium.resourceName" (dict "ctx" $ "component" "nginx") }}
8+
spec:
9+
ports:
10+
- appProtocol: http
11+
name: internal
12+
port: 8080
13+
targetPort: 8080
14+
selector:
15+
{{- include "observatorium.selectorLabels" (dict "ctx" $ "component" "nginx") | nindent 4 }}
16+
{{- end }}

charts/observatorium/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,14 @@ projects: {}
149149
# hprod-my-tenant2:
150150
global:
151151
projects: null
152+
153+
# Related to https://github.com/observatorium/api/issues/739
154+
reverseProxy:
155+
# -- Enables or disables the reverse proxy component.
156+
enabled: false
157+
# -- Hostname of the metrics backend to which requests should be proxied.
158+
metricsHost: ""
159+
# -- Hostname of the logs backend to which requests should be proxied.
160+
logsHost: ""
161+
# -- Container image used for the reverse proxy (default: non-root NGINX image).
162+
image: nginxinc/nginx-unprivileged:1.28-alpine

0 commit comments

Comments
 (0)