Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ready-donuts-hope.md
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions .changeset/spicy-cooks-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": patch
---

feat: allows specifying ingress path and pathType for different ingress controllers
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ hyperdx:
- path: /v1/(traces|metrics|logs)
pathType: Prefix
port: 4318
name: otel-collector
tls:
- hosts:
- collector.yourdomain.com
Expand Down
6 changes: 3 additions & 3 deletions charts/hdx-oss-v2/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
128 changes: 128 additions & 0 deletions charts/hdx-oss-v2/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions charts/hdx-oss-v2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ hyperdx:
ingressClassName: nginx
annotations: {}
host: "localhost" # Production domain
path: "/(.*)"
pathType: "ImplementationSpecific"
proxyBodySize: "100m"
proxyConnectTimeout: "60"
proxySendTimeout: "60"
Expand Down