diff --git a/charts/hdx-oss-v2/templates/mongodb-deployment.yaml b/charts/hdx-oss-v2/templates/mongodb-deployment.yaml index 91ea4fd..e80498d 100644 --- a/charts/hdx-oss-v2/templates/mongodb-deployment.yaml +++ b/charts/hdx-oss-v2/templates/mongodb-deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.mongodb.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -42,4 +43,5 @@ spec: targetPort: {{ .Values.mongodb.port }} selector: {{- include "hdx-oss.selectorLabels" . | nindent 4 }} - app: mongodb \ No newline at end of file + app: mongodb +{{- end }} diff --git a/charts/hdx-oss-v2/tests/mongodb-deployment_test.yaml b/charts/hdx-oss-v2/tests/mongodb-deployment_test.yaml index f66f176..4e470bd 100644 --- a/charts/hdx-oss-v2/tests/mongodb-deployment_test.yaml +++ b/charts/hdx-oss-v2/tests/mongodb-deployment_test.yaml @@ -2,11 +2,12 @@ suite: Test MongoDB Deployment templates: - mongodb-deployment.yaml tests: - - it: should render both deployment and service + - it: should render both deployment and service when enabled set: mongodb: image: mongo:5.0.14-focal port: 27017 + enabled: true asserts: - hasDocuments: count: 2 @@ -15,4 +16,12 @@ tests: of: Deployment - documentIndex: 1 isKind: - of: Service \ No newline at end of file + of: Service + + - it: should not render any documents when disabled + set: + mongodb: + enabled: false + asserts: + - hasDocuments: + count: 0 \ No newline at end of file diff --git a/charts/hdx-oss-v2/values.yaml b/charts/hdx-oss-v2/values.yaml index 265a94b..3f572bd 100644 --- a/charts/hdx-oss-v2/values.yaml +++ b/charts/hdx-oss-v2/values.yaml @@ -156,6 +156,7 @@ hyperdx: mongodb: image: "mongo:5.0.14-focal" port: 27017 + enabled: true clickhouse: image: "clickhouse/clickhouse-server:24-alpine"