Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion helm/charts/carbide-rest/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: carbide-rest
description: Umbrella chart for the Carbide REST API platform
type: application
version: 0.1.2
version: 0.1.3
appVersion: "1.0.6"
keywords:
- carbide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ metadata:
{{- include "carbide-rest-api.labels" . | nindent 4 }}
data:
config.yaml: |
{{- if .Values.secrets.dbCreds }}
{{- $config := deepCopy .Values.config -}}
{{- $_ := set $config.db "passwordPath" "/var/secrets/db/password" -}}
{{- $_ := unset $config.db "password" -}}
{{- $config | toYaml | nindent 4 }}
{{- else }}
{{- .Values.config | toYaml | nindent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ spec:
- name: temporal-tls-certs
mountPath: /var/secrets/temporal/certs
readOnly: true
{{- if .Values.secrets.dbCreds }}
- name: db-creds
mountPath: /var/secrets/db
readOnly: true
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
readinessProbe:
Expand Down Expand Up @@ -81,3 +86,11 @@ spec:
- name: temporal-tls-certs
secret:
secretName: {{ .Values.secrets.temporalClientCerts }}
{{- if .Values.secrets.dbCreds }}
- name: db-creds
secret:
secretName: {{ .Values.secrets.dbCreds }}
items:
- key: password
path: password
{{- end }}
4 changes: 4 additions & 0 deletions helm/charts/carbide-rest/charts/carbide-rest-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ secrets:
temporalClientCerts: temporal-client-cloud-certs
# -- Only required when keycloak is enabled
keycloakClientSecret: keycloak-client-secret
# -- Secret containing DB password at key "password". When set, db.password is ignored
# and the password is read from /var/secrets/db/password (supports live rotation).
dbCreds: ""

config:
env:
Expand All @@ -46,6 +49,7 @@ config:
port: 5432
name: forge
user: forge
# -- Plain-text password. Ignored when secrets.dbCreds is set.
password: forge
temporal:
host: temporal-frontend.temporal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,22 @@ app.kubernetes.io/name: carbide-rest-workflow
{{- define "carbide-rest-workflow.image" -}}
{{ .Values.global.image.repository }}/{{ .Values.image.name }}:{{ .Values.global.image.tag }}
{{- end }}

{{- define "carbide-rest-workflow.dbCredsVolumeMount" -}}
{{- if .Values.secrets.dbCreds }}
- name: db-creds
mountPath: /var/secrets/db
readOnly: true
{{- end }}
{{- end }}

{{- define "carbide-rest-workflow.dbCredsVolume" -}}
{{- if .Values.secrets.dbCreds }}
- name: db-creds
secret:
secretName: {{ .Values.secrets.dbCreds }}
items:
- key: password
path: password
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ metadata:
{{- include "carbide-rest-workflow.labels" . | nindent 4 }}
data:
config.yaml: |
{{- if .Values.secrets.dbCreds }}
{{- $config := deepCopy .Values.config -}}
{{- $_ := set $config.db "passwordPath" "/var/secrets/db/password" -}}
{{- $_ := unset $config.db "password" -}}
{{- $config | toYaml | nindent 4 }}
{{- else }}
{{- .Values.config | toYaml | nindent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ spec:
- name: temporal-tls-certs
mountPath: /var/secrets/temporal/certs
readOnly: true
{{- include "carbide-rest-workflow.dbCredsVolumeMount" . | nindent 12 }}
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -87,3 +88,4 @@ spec:
- name: temporal-tls-certs
secret:
secretName: {{ .Values.secrets.temporalClientCerts }}
{{- include "carbide-rest-workflow.dbCredsVolume" . | nindent 8 }}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ spec:
- name: temporal-tls-certs
mountPath: /var/secrets/temporal/certs
readOnly: true
{{- include "carbide-rest-workflow.dbCredsVolumeMount" . | nindent 12 }}
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -87,3 +88,4 @@ spec:
- name: temporal-tls-certs
secret:
secretName: {{ .Values.secrets.temporalClientCerts }}
{{- include "carbide-rest-workflow.dbCredsVolume" . | nindent 8 }}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ siteWorker:
secrets:
temporalEncryptionKey: temporal-encryption-key
temporalClientCerts: temporal-client-cloud-certs
# -- Secret containing DB password at key "password". When set, db.password is ignored
# and the password is read from /var/secrets/db/password (supports live rotation).
dbCreds: ""

config:
env:
Expand All @@ -38,6 +41,7 @@ config:
port: 5432
name: forge
user: forge
# -- Plain-text password. Ignored when secrets.dbCreds is set.
password: forge
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably remove this altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @thossain-nv , I will check the scope for this change and send another PR.

temporal:
host: temporal-frontend.temporal
Expand Down
Loading