From ea39328e4ba159ec783dd81d745ca386bf5bba5a Mon Sep 17 00:00:00 2001 From: Miguel Ruiz Date: Thu, 4 Apr 2024 17:52:13 +0200 Subject: [PATCH] Update chart Signed-off-by: Miguel Ruiz --- bitnami/janusgraph/Chart.lock | 8 ++--- bitnami/janusgraph/templates/_helpers.tpl | 37 +++++++++++++++++++- bitnami/janusgraph/templates/configmap.yaml | 2 +- bitnami/janusgraph/templates/deployment.yaml | 15 +++++++- bitnami/janusgraph/values.yaml | 29 +++++++++++---- 5 files changed, 77 insertions(+), 14 deletions(-) diff --git a/bitnami/janusgraph/Chart.lock b/bitnami/janusgraph/Chart.lock index 29265b48799fc3..ce091e15af99f4 100644 --- a/bitnami/janusgraph/Chart.lock +++ b/bitnami/janusgraph/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: cassandra repository: oci://registry-1.docker.io/bitnamicharts - version: 11.0.0 + version: 11.0.1 - name: common repository: oci://registry-1.docker.io/bitnamicharts - version: 2.19.0 -digest: sha256:444915dac9eb9da6d5ab7763959aeba74fbf1782772784bcfa1c0160354ddad7 -generated: "2024-03-22T12:40:07.047827+01:00" + version: 2.19.1 +digest: sha256:56cd02afb5fb2de6e6ce92b2a417314d7b266d41432ff1343d5117832ea04228 +generated: "2024-04-01T12:56:21.01822+02:00" diff --git a/bitnami/janusgraph/templates/_helpers.tpl b/bitnami/janusgraph/templates/_helpers.tpl index ae096ad289c487..1e1c7570f82926 100644 --- a/bitnami/janusgraph/templates/_helpers.tpl +++ b/bitnami/janusgraph/templates/_helpers.tpl @@ -83,11 +83,46 @@ Returns the hostname of the configured storage backend Returns the port of the configured storage backend */}} {{- define "janusgraph.storage.port" -}} -{{- if .Values.storage.external.port -}} +{{- if .Values.storage.cassandra.enabled }} +{{- printf "%d" (int .Values.cassandra.service.ports.cql) -}} +{{- else if .Values.storage.external.port -}} {{- printf "%d" (int .Values.storage.external.port) -}} {{- end -}} {{- end -}} +{{/* +Create the storage password secret name +*/}} +{{- define "janusgraph.storage.username" -}} + {{- if .Values.storage.cassandra.enabled -}} + {{- printf "%s" (default "cassandra" .Values.cassandra.dbUser.user) -}} + {{- else if .Values.storage.external.username -}} + {{- .Values.storage.external.username -}} + {{- end -}} +{{- end -}} + +{{/* +Create the storage password secret name +*/}} +{{- define "janusgraph.storage.password.secretName" -}} + {{- if .Values.storage.cassandra.enabled -}} + {{- printf "%s-cassandra" (include "common.names.fullname" .) -}} + {{- else if .Values.storage.external.existingSecret -}} + {{- .Values.storage.external.existingSecret -}} + {{- end -}} +{{- end -}} + +{{/* +Create the storage password secret key +*/}} +{{- define "janusgraph.storage.password.secretKey" -}} + {{- if .Values.storage.cassandra.enabled -}} + cassandra-password + {{- else if .Values.storage.external.existingSecretPasswordKey -}} + {{- .Values.storage.external.existingSecretPasswordKey -}} + {{- end -}} +{{- end -}} + {{/* Returns true if a index management backend has been configured */}} diff --git a/bitnami/janusgraph/templates/configmap.yaml b/bitnami/janusgraph/templates/configmap.yaml index 3828f9a878c8b5..b915ba1d5080c9 100644 --- a/bitnami/janusgraph/templates/configmap.yaml +++ b/bitnami/janusgraph/templates/configmap.yaml @@ -24,7 +24,7 @@ data: storage.directory={{ .Values.storage.berkeleyje.directory }} {{- else }} storage.hostname={{ include "janusgraph.storage.hostname" . }} - {{ if (include "janusgraph.storage.port" .)}} + {{- if (include "janusgraph.storage.port" .)}} storage.port={{ include "janusgraph.storage.port" . }} {{- end }} {{- end }} diff --git a/bitnami/janusgraph/templates/deployment.yaml b/bitnami/janusgraph/templates/deployment.yaml index 2c441e8a2492f3..82b899189a32c5 100644 --- a/bitnami/janusgraph/templates/deployment.yaml +++ b/bitnami/janusgraph/templates/deployment.yaml @@ -102,6 +102,19 @@ spec: value: {{ ternary "true" "false" .Values.metrics.enabled | quote }} - name: GREMLIN_AUTOCONFIGURE_POOL value: "true" + {{- if (include "janusgraph.storage.username" .)}} + - name: JANUSGRAPH_CFG_STORAGE_USERNAME + value: {{ include "janusgraph.storage.username" . | quote }} + - name: JANUSGRAPH_CFG_STORAGE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "janusgraph.storage.password.secretName" . }} + key: {{ include "janusgraph.storage.password.secretKey" . }} + {{- end }} + {{- if .Values.storage.cassandra.enabled }} + - name: JANUSGRAPH_CFG_STORAGE_CQL_KEYSPACE + value: {{ .Values.cassandra.keyspace | quote }} + {{- end }} {{- if .Values.extraEnvVars }} {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} {{- end }} @@ -164,7 +177,7 @@ spec: - name: janusgraph-conf mountPath: /opt/bitnami/janusgraph/conf - name: janusgraph-properties - mountPath: /opt/bitnami/janusgraph/conf/janusgraph.properties + mountPath: /bitnami/janusgraph/conf/janusgraph.properties subPath: janusgraph.properties {{- if .Values.extraVolumeMounts }} {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} diff --git a/bitnami/janusgraph/values.yaml b/bitnami/janusgraph/values.yaml index aa047085917f6f..96a9b47e090723 100644 --- a/bitnami/janusgraph/values.yaml +++ b/bitnami/janusgraph/values.yaml @@ -63,12 +63,6 @@ diagnosticMode: args: - infinity -## @section Janusgraph Parameters -## -cassandra: - image: - debug: true - resourcesPreset: "none" ## Settings for the the storage backend ## storage: @@ -89,6 +83,7 @@ storage: backend: "" hostname: "" port: "" + existingSecret: "" ## Settings for index management ## @@ -652,7 +647,7 @@ persistence: metrics: ## @param metrics.enabled Enable the export of Prometheus metrics ## - enabled: true + enabled: false ## Bitnami JMX exporter image ## ref: https://hub.docker.com/r/bitnami/jmx-exporter/tags/ ## @param metrics.image.registry [default: REGISTRY_NAME] JMX exporter image registry @@ -962,3 +957,23 @@ networkPolicy: ## ingressNSMatchLabels: {} ingressNSPodMatchLabels: {} + +## @section Cassandra storage sub-chart +## Controlled by value storage.cassandra.enabled +## +cassandra: + ## @param cassandra.keyspace Name for cassandra's janusgraph keyspace + ## + keyspace: "bitnami_janusgraph" + ## Database credentials + ## @param cassandra.dbUser.user Cassandra admin user + ## @param cassandra.dbUser.password Password for `dbUser.user`. Randomly generated if empty + ## + dbUser: + user: bn_janusgraph + password: "" + ## Cassandra service port + ## @param cassandra.service.ports.cql Cassandra cql port + service: + ports: + cql: 9043