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/metal-queens-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": patch
---

enable using remote mongodb
2 changes: 1 addition & 1 deletion charts/hdx-oss-v2/templates/configmaps/app-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
HYPERDX_APP_URL: "{{ .Values.hyperdx.appUrl }}"
HYPERDX_LOG_LEVEL: "{{ .Values.hyperdx.logLevel }}"
MINER_API_URL: "http://{{ include "hdx-oss.fullname" . }}-miner:5123"
MONGO_URI: "mongodb://{{ include "hdx-oss.fullname" . }}-mongodb:{{ .Values.mongodb.port }}/hyperdx"
MONGO_URI: "{{ tpl .Values.hyperdx.mongoUri . }}"
NEXT_PUBLIC_SERVER_URL: "http://localhost:{{ .Values.hyperdx.apiPort }}"
OTEL_SERVICE_NAME: "hdx-oss-api"
USAGE_STATS_ENABLED: "{{ .Values.hyperdx.usageStatsEnabled | default true }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/hdx-oss-v2/templates/hyperdx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ spec:
{{- end -}}
{{- end }}
spec:
{{- if not .Values.mongodb.enabled }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we enable mongodb, the initContainer is removed. Is the not here on purpose or accidental?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@junzebao sorry. I missed this, and fixed here

initContainers:
- name: wait-for-mongodb
image: busybox
command: ['sh', '-c', 'until nc -z {{ include "hdx-oss.fullname" . }}-mongodb {{ .Values.mongodb.port }}; do echo waiting for mongodb; sleep 2; done;']
{{- end }}
containers:
- name: app
image: "{{ .Values.hyperdx.image }}"
Expand Down
1 change: 1 addition & 0 deletions charts/hdx-oss-v2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ hyperdx:
usageStatsEnabled: true
# Endpoint to send hyperdx logs/traces/metrics to.Defaults to the chart's otel collector endpoint.
otelExporterEndpoint: http://{{ include "hdx-oss.fullname" . }}-otel-collector:{{ .Values.otel.httpPort }}
mongoUri: mongodb://{{ include "hdx-oss.fullname" . }}-mongodb:{{ .Values.mongodb.port }}/hyperdx
Copy link
Contributor Author

@OhJuhun OhJuhun Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wrn14897 I think this doesn't work.

Copy link
Contributor Author

@OhJuhun OhJuhun Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wrn14897
I think the best way to implement this is writing on _helpers.tpl. How do you think?
like this:

{{- define "hdx-oss.mongodb.uri" -}}
{{- if .Values.hyperdx.mongoUri -}}
    {{- printf .Values.hyperdx.mongoUri -}}
{{- else -}}
    {{- $mongodbPort := .Values.mongodb.port -}}
    {{- printf "mongodb://%s-mongodb:%d/hyperdx" (include "hdx-oss.fullname" .) ( $mongodbPort | int ) -}}
{{- end -}}
{{- end -}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wrn14897 sry. i missed write tpl. i fixed ignore this comments

annotations: {}
# myAnnotation: "myValue"
labels: {}
Expand Down