Skip to content

Commit

Permalink
Nucliadb Charts: allow for extended environment configuration (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepellin authored Sep 3, 2024
1 parent 0b92347 commit 4d75f6e
Show file tree
Hide file tree
Showing 34 changed files with 149 additions and 26 deletions.
4 changes: 4 additions & 0 deletions charts/nucliadb/templates/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.envFrom }}
envFrom:
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
ports:
- name: http
containerPort: 8080
Expand Down
6 changes: 6 additions & 0 deletions charts/nucliadb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ env:
log_output_type: stdout
log_format_type: structured

envFrom: # Additonal configmaps and secrets to mount into the environment
# - configMapRef:
# name: configMapName
# - secretRef:
# name: secretName

envSecrets:
# - name: NUA_API_KEY
# valueFrom:
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_ingest/templates/_cronjob_purge.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 14 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_ingest/templates/exporter.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_ingest/templates/ingest-orm-grpc.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
4 changes: 0 additions & 4 deletions charts/nucliadb_ingest/templates/ingest.cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ data:
{{- if .Values.debug }}
LOG_LEVEL: "DEBUG"
{{- end }}
SENTRY_URL: {{ .Values.running.sentry_url }}

INDEX_JETSTREAM_SERVERS: {{ toJson .Values.indexing.index_jetstream_servers | quote }}
INDEX_JETSTREAM_AUTH: {{ .Values.indexing.index_jetstream_auth }}

TOTAL_REPLICAS: {{ .Values.replicaCount | quote }}

JAEGER_ENABLED: {{ .Values.tracing.enabled | quote }}
14 changes: 14 additions & 0 deletions charts/nucliadb_ingest/templates/ingest.secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-config
labels:
app: ingest
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
{{- if ((.Values.running).sentry_url) }}
SENTRY_URL: {{ .Values.running.sentry_url | b64enc }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/nucliadb_ingest/templates/ingest.sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_ingest/templates/migrator.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_ingest/templates/rebalance.cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 14 }}
{{- end }}
Expand Down
4 changes: 3 additions & 1 deletion charts/nucliadb_ingest/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ env: {}
# Configmap and/or secrets to mount into the environment
envFrom:
- configMapRef:
name: nucliadb-config
name: nucliadb-config # Nucliadb-shared configMap
- secretRef:
name: nucliadb-config # Nucliadb-shared secret

# Kubernetes settings
config:
Expand Down
1 change: 0 additions & 1 deletion charts/nucliadb_node/templates/node.cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
data:
RUST_LIB_BACKTRACE: "1"
HOST_KEY_PATH: "{{ .Values.config.data_path }}/node.key"
SENTRY_URL: {{ .Values.running.sentry_url }}
READER_LISTEN_ADDRESS: 0.0.0.0:{{ .Values.serving.grpc_reader }}
WRITER_LISTEN_ADDRESS: 0.0.0.0:{{ .Values.serving.grpc_writer }}
SIDECAR_LISTEN_ADDRESS: 0.0.0.0:{{ .Values.serving.grpc_sidecar }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_node/templates/node.replicas.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ spec:
envFrom:
- configMapRef:
name: node-config
- secretRef:
name: node-config
{{- if $values.envFrom }}
{{- toYaml $values.envFrom | nindent 10 }}
{{- end }}
Expand Down
15 changes: 15 additions & 0 deletions charts/nucliadb_node/templates/node.secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Secret
metadata:
name: node-config
labels:
app: node
app.kubernetes.io/name: node
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
data:
{{- if ((.Values.running).sentry_url) }}
SENTRY_URL: {{ .Values.running.sentry_url | b64enc }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/nucliadb_node/templates/node.sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ spec:
envFrom:
- configMapRef:
name: node-config
- secretRef:
name: node-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down Expand Up @@ -121,6 +123,8 @@ spec:
envFrom:
- configMapRef:
name: node-config
- secretRef:
name: node-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down Expand Up @@ -158,6 +162,8 @@ spec:
envFrom:
- configMapRef:
name: node-config
- secretRef:
name: node-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
4 changes: 3 additions & 1 deletion charts/nucliadb_node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ env: {}
# Configmap and/or secrets to mount into the environment
envFrom:
- configMapRef:
name: nucliadb-config
name: nucliadb-config # Nucliadb-shared configMap
- secretRef:
name: nucliadb-config # Nucliadb-shared secret

# Kubernetes settings
config:
Expand Down
1 change: 0 additions & 1 deletion charts/nucliadb_reader/templates/reader.cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ metadata:
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
data:
SENTRY_URL: {{ .Values.running.sentry_url }}
JAEGER_ENABLED: {{ .Values.tracing.enabled | quote }}
SERVING_PORT: {{ .Values.serving.port | quote }}
METRICS_PORT: {{ .Values.serving.metricsPort | quote }}
2 changes: 2 additions & 0 deletions charts/nucliadb_reader/templates/reader.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spec:
envFrom:
- configMapRef:
name: reader-config
- secretRef:
name: reader-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
15 changes: 15 additions & 0 deletions charts/nucliadb_reader/templates/reader.secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Secret
metadata:
name: reader-config
labels:
app: reader
app.kubernetes.io/name: reader
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
data:
{{- if ((.Values.running).sentry_url) }}
SENTRY_URL: {{ .Values.running.sentry_url | b64enc }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/nucliadb_reader/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ env: {}
# Configmap and/or secrets to mount into the environment
envFrom:
- configMapRef:
name: nucliadb-config
name: nucliadb-config # Nucliadb-shared configMap
- secretRef:
name: nucliadb-config # Nucliadb-shared secret

# Kubernetes settings
affinity: {}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_search/templates/search.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spec:
envFrom:
- configMapRef:
name: search-config
- secretRef:
name: search-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
15 changes: 15 additions & 0 deletions charts/nucliadb_search/templates/search.secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Secret
metadata:
name: search-config
labels:
app: search
app.kubernetes.io/name: search
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
data:
{{- if ((.Values.running).sentry_url) }}
SENTRY_URL: {{ .Values.running.sentry_url | b64enc }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/nucliadb_search/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ env:
# Configmap and/or secrets to mount into the environment
envFrom:
- configMapRef:
name: nucliadb-config
name: nucliadb-config # Nucliadb-shared configMap
- secretRef:
name: nucliadb-config # Nucliadb-shared secret

# Kubernetes settings
affinity: {}
Expand Down
12 changes: 0 additions & 12 deletions charts/nucliadb_shared/templates/nucliadb.cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ data:
GCS_PROJECT: {{ .Values.storage.gcs_project }}
GCS_BUCKET_LABELS: {{ toJson .Values.storage.gcs_bucket_labels | quote }}
{{- else if eq .Values.storage.file_backend "s3" }}
{{- if eq .Values.storage.s3_irsa "disabled" }}
S3_CLIENT_ID: {{ .Values.storage.s3_client_id }}
S3_CLIENT_SECRET: {{ .Values.storage.s3_client_secret }}
{{- end }}
{{- if .Values.storage.s3_ssl }}
S3_SSL: "True"
{{- end }}
Expand All @@ -51,7 +47,6 @@ data:
{{- else }}
ONPREM: "False"
{{- end }}
NUCLIA_JWT_KEY: {{ .Values.nuclia.nuclia_jwt_key }}
NUCLIA_HASH_SEED: {{ .Values.nuclia.nuclia_hash_seed | quote }}
NUCLIA_PARTITIONS: {{ .Values.nuclia.nuclia_partitions | quote }}
NUCLIADB_INGEST: {{ .Values.nucliadb.ingest }}
Expand All @@ -70,9 +65,6 @@ data:
{{- end}}
INDEX_JETSTREAM_SERVERS: {{ toJson .Values.indexing.index_jetstream_servers | quote }}
DRIVER: {{ .Values.maindb.driver }}
{{- if eq .Values.maindb.driver "pg" }}
DRIVER_PG_URL: {{ .Values.maindb.driver_pg_url }}
{{- end }}
AUDIT_DRIVER: {{ .Values.audit.driver }}
AUDIT_JETSTREAM_TARGET: {{ .Values.audit.audit_jetstream_target }}
AUDIT_JETSTREAM_SERVERS: {{ toJson .Values.audit.audit_jetstream_servers | quote }}
Expand All @@ -95,8 +87,4 @@ data:
{{- if .Values.flag_settings_url }}
FLAG_SETTINGS_URL: "{{ .Values.flag_settings_url }}"
{{- end }}

{{- if .Values.encryption.secret_key }}
ENCRYPTION_SECRET_KEY: {{ .Values.encryption.secret_key }}
{{- end }}
{{- end }}
1 change: 0 additions & 1 deletion charts/nucliadb_train/templates/train.cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ metadata:
chart: "{{ .Chart.Name }}"
data:
GRPC_PORT: {{ .Values.serving.grpc_port | quote }}
SENTRY_URL: {{ .Values.running.sentry_url }}
SERVING_PORT: {{ .Values.serving.port | quote }}
JAEGER_ENABLED: {{ .Values.tracing.enabled | quote }}
METRICS_PORT: {{ .Values.serving.metricsPort | quote }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_train/templates/train.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ spec:
envFrom:
- configMapRef:
name: train-config
- secretRef:
name: train-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
16 changes: 16 additions & 0 deletions charts/nucliadb_train/templates/train.secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Secret
metadata:
name: train-config
labels:
app: train
app.kubernetes.io/name: train
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
data:
{{- if ((.Values.running).sentry_url) }}
SENTRY_URL: {{ .Values.running.sentry_url | b64enc }}
{{- end }}

4 changes: 3 additions & 1 deletion charts/nucliadb_train/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ env: {}
# Additional environment variables to provided via envFrom reference
envFrom:
- configMapRef:
name: nucliadb-config
name: nucliadb-config # Nucliadb-shared configMap
- secretRef:
name: nucliadb-config # Nucliadb-shared secret

# Kubernetes settings
affinity: {}
Expand Down
1 change: 0 additions & 1 deletion charts/nucliadb_writer/templates/writer.cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ metadata:
data:
DM_REDIS_HOST: {{ .Values.config.dm_redis_host }}
DM_REDIS_PORT: {{ .Values.config.dm_redis_port | quote }}
SENTRY_URL: {{ .Values.running.sentry_url }}
{{- if .Values.tracing.enabled }}
JAEGER_ENABLED: "True"
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nucliadb_writer/templates/writer.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spec:
envFrom:
- configMapRef:
name: writer-config
- secretRef:
name: writer-config
{{- if .Values.envFrom }}
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
Expand Down
Loading

0 comments on commit 4d75f6e

Please sign in to comment.