Skip to content

Agent Mesh

fix(helm): make postgres database port and sslmode configurable

Antonio Ojeaf6d781833923
diff --git a/charts/sam-mesh/templates/control-plane-deployment.yaml b/charts/sam-mesh/templates/control-plane-deployment.yaml
index ecf33184..16aefe8f 100644
--- a/charts/sam-mesh/templates/control-plane-deployment.yaml
+++ b/charts/sam-mesh/templates/control-plane-deployment.yaml
@@ -19,7 +19,7 @@ spec:
- name: wait-for-db
image: busybox:1.36.1
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
- command: ['sh', '-c', 'until nc -w3 {{ include "sam-mesh.fullname" . }}-db 5432 </dev/null; do echo waiting for db; sleep 1; done']
+ command: ['sh', '-c', 'until nc -w3 {{ include "sam-mesh.fullname" . }}-db {{ .Values.database.postgres.port | default 5432 }} </dev/null; do echo waiting for db; sleep 1; done']
{{- end }}
containers:
- name: sam-control-plane
@@ -61,7 +61,7 @@ spec:
{{- if not .Values.database.postgres.deployInternal }}
{{- $dbHost = .Values.database.postgres.host }}
{{- end }}
- - "--db-dsn=postgres://{{ .Values.database.postgres.user }}:$(DB_PASSWORD)@{{ $dbHost }}:5432/{{ .Values.database.postgres.database }}?sslmode=disable"
+ - "--db-dsn=postgres://{{ .Values.database.postgres.user }}:$(DB_PASSWORD)@{{ $dbHost }}:{{ .Values.database.postgres.port | default 5432 }}/{{ .Values.database.postgres.database }}?sslmode={{ .Values.database.postgres.sslmode | default "disable" }}"
{{- else }}
- "--db-driver=sqlite"
- "--db-dsn=/data/control-plane.db"
diff --git a/charts/sam-mesh/values.yaml b/charts/sam-mesh/values.yaml
index ad23c7e3..728bba35 100644
--- a/charts/sam-mesh/values.yaml
+++ b/charts/sam-mesh/values.yaml
@@ -27,6 +27,8 @@ database:
user: sam
password: sam-secret-password
database: sam_mesh
+ port: 5432
+ sslmode: disable
storageSize: 1Gi
router: