Skip to content

Commit d516dc5

Browse files
authored
Merge branch 'main' into tom/fix-next-frontend-url
2 parents 9505056 + b82c57d commit d516dc5

16 files changed

+415
-81
lines changed

.changeset/plenty-olives-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"helm-charts": patch
3+
---
4+
5+
fix: Update FRONTEND_URL to be dynamic w/ingress

.changeset/plenty-pears-yawn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"helm-charts": patch
3+
---
4+
5+
fix: Allow for configurable service type + annotations

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# helm-charts
22

3+
## 0.6.3
4+
5+
### Patch Changes
6+
7+
- 39d37c5: fix if condition typo
8+
- 3d75672: fix: Fix pathType for ingress
9+
310
## 0.6.2
411

512
### Patch Changes

README.md

Lines changed: 170 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Welcome to the official HyperDX Helm charts repository. This guide provides inst
1818
- [API Key Setup](#api-key-setup)
1919
- [Task Configuration](#task-configuration)
2020
- [Using Secrets](#using-secrets)
21+
- [Ingress Setup](#ingress-setup)
2122
- [Operations](#operations)
2223
- [Upgrading](#upgrading-the-chart)
2324
- [Uninstalling](#uninstalling-hyperdx)
@@ -108,36 +109,7 @@ hyperdx:
108109
109110
#### Configuring Ingress for OTEL Collector
110111
111-
If you need to expose your OTEL collector endpoints through ingress, you can use the additional ingresses configuration. The example below uses a regex pattern to capture all OTLP endpoints (traces, metrics, and logs) in a single path rule:
112-
113-
```yaml
114-
hyperdx:
115-
ingress:
116-
enabled: true
117-
additionalIngresses:
118-
- name: otel-collector
119-
annotations:
120-
nginx.ingress.kubernetes.io/ssl-redirect: "false"
121-
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
122-
nginx.ingress.kubernetes.io/use-regex: "true"
123-
ingressClassName: nginx
124-
hosts:
125-
- host: collector.yourdomain.com
126-
paths:
127-
- path: /v1/(traces|metrics|logs)
128-
pathType: Prefix
129-
port: 4318
130-
tls:
131-
- hosts:
132-
- collector.yourdomain.com
133-
secretName: collector-tls
134-
```
135-
136-
This configuration creates a separate ingress resource for the OTEL collector endpoints, allowing you to:
137-
- Use a different domain for collector traffic
138-
- Configure specific TLS settings
139-
- Apply custom annotations for the collector ingress
140-
- Route all telemetry signals through a single regex-based path rule
112+
For instructions on exposing your OTEL collector endpoints via ingress (including example configuration and best practices), see the [OTEL Collector Ingress](#otel-collector-ingress) section in the [Ingress Setup](#ingress-setup) chapter above.
141113
142114
### Minimal Deployment
143115
@@ -263,6 +235,173 @@ By default, there is one task in the chart setup as a cronjob, responsible for c
263235
| `tasks.checkAlerts.schedule` | Cron schedule for the check-alerts task | `*/1 * * * *` |
264236
| `tasks.checkAlerts.resources` | Resource requests and limits for the check-alerts task | See `values.yaml` |
265237

238+
## Ingress Setup
239+
240+
- [General Ingress Setup](#general-ingress-setup)
241+
- [OTEL Collector Ingress](#otel-collector-ingress)
242+
- [Troubleshooting Ingress](#troubleshooting-ingress)
243+
244+
### General Ingress Setup
245+
246+
To expose the HyperDX UI and API via a domain name, enable ingress in your `values.yaml`:
247+
248+
```yaml
249+
hyperdx:
250+
ingress:
251+
enabled: true
252+
host: "hyperdx.yourdomain.com" # Set this to your desired domain
253+
```
254+
255+
#### Configuring `ingress.host` and `hyperdx.appUrl`
256+
257+
- **`hyperdx.ingress.host`**: Set to the domain you want to use for accessing HyperDX (e.g., `hyperdx.yourdomain.com`).
258+
- **`hyperdx.appUrl`**: Should match the ingress host and include the protocol (e.g., `https://hyperdx.yourdomain.com`).
259+
260+
**Example:**
261+
```yaml
262+
hyperdx:
263+
appUrl: "https://hyperdx.yourdomain.com"
264+
ingress:
265+
enabled: true
266+
host: "hyperdx.yourdomain.com"
267+
```
268+
269+
This ensures that all generated links, cookies, and redirects work correctly.
270+
271+
#### Enabling TLS (HTTPS)
272+
273+
To secure your deployment with HTTPS, enable TLS in your ingress configuration:
274+
275+
```yaml
276+
hyperdx:
277+
ingress:
278+
enabled: true
279+
host: "hyperdx.yourdomain.com"
280+
tls:
281+
enabled: true
282+
tlsSecretName: "hyperdx-tls" # Name of the Kubernetes TLS secret
283+
```
284+
285+
- Create a Kubernetes TLS secret with your certificate and key:
286+
```sh
287+
kubectl create secret tls hyperdx-tls \
288+
--cert=path/to/tls.crt \
289+
--key=path/to/tls.key
290+
```
291+
- The ingress will reference this secret to terminate HTTPS connections.
292+
293+
#### Example Minimal Ingress YAML
294+
295+
```yaml
296+
apiVersion: networking.k8s.io/v1
297+
kind: Ingress
298+
metadata:
299+
name: hyperdx-app-ingress
300+
annotations:
301+
nginx.ingress.kubernetes.io/rewrite-target: /$1
302+
nginx.ingress.kubernetes.io/use-regex: "true"
303+
spec:
304+
ingressClassName: nginx
305+
rules:
306+
- host: hyperdx.yourdomain.com
307+
http:
308+
paths:
309+
- path: /(.*)
310+
pathType: ImplementationSpecific
311+
backend:
312+
service:
313+
name: <service-name>
314+
port:
315+
number: 3000
316+
tls:
317+
- hosts:
318+
- hyperdx.yourdomain.com
319+
secretName: hyperdx-tls
320+
```
321+
322+
#### Common Pitfalls
323+
324+
- **Path and Rewrite Configuration:**
325+
- For Next.js and other SPAs, always use a regex path and rewrite annotation as shown above. Do not use just `path: /` without a rewrite, as this will break static asset serving.
326+
- **Mismatched `appUrl` and `ingress.host`:**
327+
- If these do not match, you may experience issues with cookies, redirects, and asset loading.
328+
- **TLS Misconfiguration:**
329+
- Ensure your TLS secret is valid and referenced correctly in the ingress.
330+
- Browsers may block insecure content if you access the app over HTTP when TLS is enabled.
331+
- **Ingress Controller Version:**
332+
- Some features (like regex paths and rewrites) require recent versions of nginx ingress controller. Check your version with:
333+
```sh
334+
kubectl -n ingress-nginx get pods -l app.kubernetes.io/name=ingress-nginx -o jsonpath="{.items[0].spec.containers[0].image}"
335+
```
336+
337+
---
338+
339+
### OTEL Collector Ingress
340+
341+
If you need to expose your OTEL collector endpoints (for traces, metrics, logs) through ingress, you can use the `additionalIngresses` configuration. This is useful for organizations that want to send telemetry data from outside the cluster or use a custom domain for the collector.
342+
343+
**Example configuration:**
344+
345+
```yaml
346+
hyperdx:
347+
ingress:
348+
enabled: true
349+
additionalIngresses:
350+
- name: otel-collector
351+
annotations:
352+
nginx.ingress.kubernetes.io/ssl-redirect: "false"
353+
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
354+
nginx.ingress.kubernetes.io/use-regex: "true"
355+
ingressClassName: nginx
356+
hosts:
357+
- host: collector.yourdomain.com
358+
paths:
359+
- path: /v1/(traces|metrics|logs)
360+
pathType: Prefix
361+
port: 4318
362+
tls:
363+
- hosts:
364+
- collector.yourdomain.com
365+
secretName: collector-tls
366+
```
367+
368+
- This creates a separate ingress resource for the OTEL collector endpoints.
369+
- You can use a different domain, configure specific TLS settings, and apply custom annotations for the collector ingress.
370+
- The regex path rule allows you to route all OTLP signals (traces, metrics, logs) through a single rule.
371+
372+
**Note:**
373+
- If you do not need to expose the OTEL collector externally, you can skip this section.
374+
- For most users, the general ingress setup is sufficient.
375+
376+
---
377+
378+
### Troubleshooting Ingress
379+
380+
- **Check Ingress Resource:**
381+
```sh
382+
kubectl get ingress -A
383+
kubectl describe ingress <ingress-name>
384+
```
385+
- **Check Pod Logs:**
386+
```sh
387+
kubectl logs -l app.kubernetes.io/name=ingress-nginx -n ingress-nginx
388+
```
389+
- **Test Asset URLs:**
390+
Use `curl` to verify static assets are served as JS, not HTML:
391+
```sh
392+
curl -I https://hyperdx.yourdomain.com/_next/static/chunks/main-xxxx.js
393+
# Should return Content-Type: application/javascript
394+
```
395+
- **Browser DevTools:**
396+
- Check the Network tab for 404s or assets returning HTML instead of JS.
397+
- Look for errors like "Unexpected token <" in the console (indicates HTML returned for JS).
398+
- **Check for Path Rewrites:**
399+
- Ensure the ingress is not stripping or incorrectly rewriting asset paths.
400+
- **Clear Browser and CDN Cache:**
401+
- After changes, clear your browser cache and any CDN/proxy cache to avoid stale assets.
402+
403+
---
404+
266405
## Operations
267406

268407
### Upgrading the Chart
@@ -392,41 +531,4 @@ For HTTP-only deployments (development/testing), some browsers may show crypto A
392531

393532
```sh
394533
kubectl logs -l app.kubernetes.io/name=hdx-oss-v2
395-
```
396-
397-
### OTEL Collector OpAMP Connection Issues
398-
399-
If you see connection refused errors in OTEL collector logs:
400-
401-
```sh
402-
# Check OTEL collector logs
403-
kubectl logs -l app=otel-collector
404-
405-
# Verify service DNS resolution
406-
kubectl exec -it deployment/my-hyperdx-hdx-oss-v2-otel-collector -- nslookup my-hyperdx-hdx-oss-v2-app
407-
```
408-
409-
### Debugging a Failed Install
410-
411-
```sh
412-
helm install my-hyperdx hyperdx/hdx-oss-v2 --debug --dry-run
413-
```
414-
415-
### Verifying Deployment
416-
417-
```sh
418-
kubectl get pods -l app.kubernetes.io/name=hdx-oss-v2
419-
```
420-
421-
For more details, refer to the [Helm documentation](https://helm.sh/docs/) or open an issue in this repository.
422-
423-
---
424-
425-
## Contributing
426-
427-
We welcome contributions! Please open an issue or submit a pull request if you have improvements or feature requests.
428-
429-
## License
430-
431-
This project is licensed under the [MIT License](LICENSE).
432-
534+
```

charts/hdx-oss-v2/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: hdx-oss-v2
33
description: A Helm chart for HyperDX OSS V2
44
type: application
5-
version: 0.6.2
5+
version: 0.6.3
66
appVersion: 2.0.1

charts/hdx-oss-v2/templates/NOTES.txt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,28 @@ Note: By default, this chart also installs clickhouse and the otel-collector. Ho
44
it is recommended that you use the clickhouse and otel-collector operators instead.
55

66
To disable clickhouse and otel-collector, set the following values:
7-
helm install myrelease hyperdx-helm --set clickhouse.enabled=false --set clickhouse.persistence.enabled=false --set otel.enabled=false
7+
helm install myrelease <chart-name-or-path> --set clickhouse.enabled=false --set clickhouse.persistence.enabled=false --set otel.enabled=false
88

9-
Application URL: {{ include "hdx-oss.fullname" . }}-app:{{ .Values.hyperdx.appPort }}
9+
{{- if .Values.hyperdx.ingress.enabled }}
10+
Application URL: {{ if .Values.hyperdx.ingress.tls.enabled }}https{{ else }}http{{ end }}://{{ .Values.hyperdx.ingress.host }}
11+
{{- else }}
12+
Application Access:
13+
For security, the service uses ClusterIP and is not exposed externally by default.
14+
Choose one of the following secure access methods:
15+
16+
1. Enable Ingress with TLS (Recommended for Production):
17+
helm upgrade {{ .Release.Name }} <chart-name-or-path> \
18+
--set hyperdx.ingress.enabled=true \
19+
--set hyperdx.ingress.host=your-domain.com \
20+
--set hyperdx.ingress.tls.enabled=true
21+
22+
2. Port Forward (Development/Testing):
23+
kubectl port-forward svc/{{ include "hdx-oss.fullname" . }}-app {{ .Values.hyperdx.appPort }}:{{ .Values.hyperdx.appPort }}
24+
Then access: http://localhost:{{ .Values.hyperdx.appPort }}
25+
26+
Note: This application handles sensitive telemetry data and should not be exposed
27+
directly to the internet without proper authentication and encryption.
28+
{{- end }}
1029

1130
To verify the deployment status, run:
1231
kubectl get pods -l "app.kubernetes.io/name={{ include "hdx-oss.name" . }}"

charts/hdx-oss-v2/templates/configmaps/app-configmap.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ metadata:
77
data:
88
APP_PORT: {{ .Values.hyperdx.appPort | quote }}
99
API_PORT: {{ .Values.hyperdx.apiPort | quote }}
10+
{{- if .Values.hyperdx.ingress.enabled }}
11+
FRONTEND_URL: "{{ if .Values.hyperdx.ingress.tls.enabled }}https{{ else }}http{{ end }}://{{ .Values.hyperdx.ingress.host }}"
12+
{{- else }}
1013
FRONTEND_URL: "{{ .Values.hyperdx.appUrl }}:{{ .Values.hyperdx.appPort }}"
14+
{{- end }}
1115
HYPERDX_API_PORT: "{{ .Values.hyperdx.apiPort }}"
1216
HYPERDX_APP_PORT: "{{ .Values.hyperdx.appPort }}"
1317
HYPERDX_APP_URL: "{{ .Values.hyperdx.appUrl }}"

charts/hdx-oss-v2/templates/hyperdx-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
{{- end -}}
2929
{{- end }}
3030
spec:
31-
{{- if not .Values.mongodb.enabled }}
31+
{{- if .Values.mongodb.enabled }}
3232
initContainers:
3333
- name: wait-for-mongodb
3434
image: busybox

charts/hdx-oss-v2/templates/hyperdx-service.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ metadata:
44
name: {{ include "hdx-oss.fullname" . }}-app
55
labels:
66
{{- include "hdx-oss.labels" . | nindent 4 }}
7+
{{- if .Values.hyperdx.service.annotations }}
8+
annotations:
9+
{{- with .Values.hyperdx.service.annotations }}
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- end }}
713
spec:
8-
type: LoadBalancer
14+
type: {{ .Values.hyperdx.service.type | default "ClusterIP" }}
915
ports:
1016
- port: {{ .Values.hyperdx.appPort }}
1117
targetPort: {{ .Values.hyperdx.appPort }}
@@ -15,4 +21,4 @@ spec:
1521
name: opamp
1622
selector:
1723
{{- include "hdx-oss.selectorLabels" . | nindent 4 }}
18-
app: {{ include "hdx-oss.fullname" . }}
24+
app: {{ include "hdx-oss.fullname" . }}

charts/hdx-oss-v2/templates/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
http:
3535
paths:
3636
- path: /(.*)
37-
pathType: Prefix
37+
pathType: ImplementationSpecific
3838
backend:
3939
service:
4040
name: {{ include "hdx-oss.fullname" . }}-app

0 commit comments

Comments
 (0)