From 50be4cd17c12f4d836b9fbd5f5b7812dac31ed27 Mon Sep 17 00:00:00 2001 From: Mike Shi Date: Mon, 28 Jul 2025 11:35:06 -0700 Subject: [PATCH 1/4] Improve ingress configs --- charts/hdx-oss-v2/templates/ingress.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/hdx-oss-v2/templates/ingress.yaml b/charts/hdx-oss-v2/templates/ingress.yaml index 4283d03..1970def 100644 --- a/charts/hdx-oss-v2/templates/ingress.yaml +++ b/charts/hdx-oss-v2/templates/ingress.yaml @@ -33,8 +33,8 @@ spec: - host: {{ .Values.hyperdx.ingress.host | default "localhost" }} http: paths: - - path: /(.*) - pathType: ImplementationSpecific + - path: {{ .Values.hyperdx.ingress.path | default "/(.*)" }} + pathType: {{ .Values.hyperdx.ingress.pathType | default "ImplementationSpecific" }} backend: service: name: {{ include "hdx-oss.fullname" . }}-app @@ -87,7 +87,7 @@ spec: pathType: {{ .pathType }} backend: service: - name: {{ include "hdx-oss.fullname" $ }} + name: {{ if .name }}{{ printf "%s-%s" (include "hdx-oss.fullname" $) .name }}{{ else }}{{ include "hdx-oss.fullname" $ }}{{ end }} port: number: {{ .port }} {{- end }} From f26a2ab57e5b759ff6207bc7bfaf49aa1240562e Mon Sep 17 00:00:00 2001 From: Mike Shi Date: Mon, 28 Jul 2025 11:36:53 -0700 Subject: [PATCH 2/4] update README with otel-collector ingress example --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7417dbc..f657931 100644 --- a/README.md +++ b/README.md @@ -359,6 +359,7 @@ hyperdx: - path: /v1/(traces|metrics|logs) pathType: Prefix port: 4318 + name: otel-collector tls: - hosts: - collector.yourdomain.com From 21a93aeeffd9c7c7eb87d6fa1409e64ecfc1c8c1 Mon Sep 17 00:00:00 2001 From: Warren Lee <5959690+wrn14897@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:49:25 -0700 Subject: [PATCH 3/4] feedback: add default values + unit tests --- charts/hdx-oss-v2/tests/ingress_test.yaml | 128 ++++++++++++++++++++++ charts/hdx-oss-v2/values.yaml | 2 + 2 files changed, 130 insertions(+) diff --git a/charts/hdx-oss-v2/tests/ingress_test.yaml b/charts/hdx-oss-v2/tests/ingress_test.yaml index d7af841..14f5efe 100644 --- a/charts/hdx-oss-v2/tests/ingress_test.yaml +++ b/charts/hdx-oss-v2/tests/ingress_test.yaml @@ -481,3 +481,131 @@ tests: asserts: - failedTemplate: errorMessage: "Each path in additional ingress must contain path, pathType, and port properties" + + - it: should use custom path and pathType when provided + set: + hyperdx: + ingress: + enabled: true + host: hyperdx.example.com + path: /api/(.*) + pathType: Prefix + tls: + enabled: false + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Ingress + - equal: + path: spec.rules[0].http.paths[0].path + value: /api/(.*) + - equal: + path: spec.rules[0].http.paths[0].pathType + value: Prefix + + - it: should use default path and pathType when not provided + set: + hyperdx: + ingress: + enabled: true + host: hyperdx.example.com + tls: + enabled: false + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Ingress + - equal: + path: spec.rules[0].http.paths[0].path + value: /(.*) + - equal: + path: spec.rules[0].http.paths[0].pathType + value: ImplementationSpecific + + - it: should allow Exact pathType + set: + hyperdx: + ingress: + enabled: true + host: hyperdx.example.com + path: /hyperdx + pathType: Exact + tls: + enabled: false + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Ingress + - equal: + path: spec.rules[0].http.paths[0].path + value: /hyperdx + - equal: + path: spec.rules[0].http.paths[0].pathType + value: Exact + + - it: should use service name suffix when name is provided in additional ingress paths + set: + hyperdx: + ingress: + enabled: true + host: hyperdx.example.com + additionalIngresses: + - name: custom-service + ingressClassName: nginx + hosts: + - host: custom.example.com + paths: + - path: /api + pathType: Prefix + port: 8080 + name: api-service + - path: /metrics + pathType: Exact + port: 9090 + name: metrics + asserts: + - hasDocuments: + count: 2 + # Check the additional ingress (document 1) + - isKind: + of: Ingress + documentIndex: 1 + - equal: + path: spec.rules[0].http.paths[0].backend.service.name + value: RELEASE-NAME-hdx-oss-v2-api-service + documentIndex: 1 + - equal: + path: spec.rules[0].http.paths[1].backend.service.name + value: RELEASE-NAME-hdx-oss-v2-metrics + documentIndex: 1 + + - it: should use default service name when name is not provided in additional ingress paths + set: + hyperdx: + ingress: + enabled: true + host: hyperdx.example.com + additionalIngresses: + - name: default-service + ingressClassName: nginx + hosts: + - host: default.example.com + paths: + - path: / + pathType: Prefix + port: 8080 + # name field is not provided + asserts: + - hasDocuments: + count: 2 + # Check the additional ingress (document 1) + - isKind: + of: Ingress + documentIndex: 1 + - equal: + path: spec.rules[0].http.paths[0].backend.service.name + value: RELEASE-NAME-hdx-oss-v2 + documentIndex: 1 diff --git a/charts/hdx-oss-v2/values.yaml b/charts/hdx-oss-v2/values.yaml index f09e51d..4bf6780 100644 --- a/charts/hdx-oss-v2/values.yaml +++ b/charts/hdx-oss-v2/values.yaml @@ -163,6 +163,8 @@ hyperdx: ingressClassName: nginx annotations: {} host: "localhost" # Production domain + path: "/(.*)" + pathType: "ImplementationSpecific" proxyBodySize: "100m" proxyConnectTimeout: "60" proxySendTimeout: "60" From e79999c73cafa5b646c6bfcd1334119a9bbb90b6 Mon Sep 17 00:00:00 2001 From: Warren <5959690+wrn14897@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:52:15 -0700 Subject: [PATCH 4/4] docs: add changeset --- .changeset/ready-donuts-hope.md | 5 +++++ .changeset/spicy-cooks-study.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/ready-donuts-hope.md create mode 100644 .changeset/spicy-cooks-study.md diff --git a/.changeset/ready-donuts-hope.md b/.changeset/ready-donuts-hope.md new file mode 100644 index 0000000..4ad41aa --- /dev/null +++ b/.changeset/ready-donuts-hope.md @@ -0,0 +1,5 @@ +--- +"helm-charts": patch +--- + +feat: allows customizing additional ingresses service names to route to the correct otel collector service (with README update) diff --git a/.changeset/spicy-cooks-study.md b/.changeset/spicy-cooks-study.md new file mode 100644 index 0000000..987bd6d --- /dev/null +++ b/.changeset/spicy-cooks-study.md @@ -0,0 +1,5 @@ +--- +"helm-charts": patch +--- + +feat: allows specifying ingress path and pathType for different ingress controllers