Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Add support for existing pg secret
Maidul Islamf186ce964903
diff --git a/helm-charts/infisical-standalone-postgres/templates/infisical.yaml b/helm-charts/infisical-standalone-postgres/templates/infisical.yamlindex 4727e20fd6..71a0e51483 100644--- a/helm-charts/infisical-standalone-postgres/templates/infisical.yaml+++ b/helm-charts/infisical-standalone-postgres/templates/infisical.yaml@@ -55,6 +55,13 @@ spec:ports:- containerPort: 8080env:+ {{- if .Values.postgresql.useExistingPostgresSecret.enabled }}+ - name: DB_CONNECTION_URI+ valueFrom:+ secretKeyRef:+ name: {{ .Values.postgresql.useExistingPostgresSecret.existingConnectionStringSecret.name }}+ key: {{ .Values.postgresql.useExistingPostgresSecret.existingConnectionStringSecret.key }}+ {{- end }}{{- if .Values.postgresql.enabled }}- name: DB_CONNECTION_URIvalue: {{ include "infisical.postgresDBConnectionString" . }}diff --git a/helm-charts/infisical-standalone-postgres/templates/jobs-rbac.yaml b/helm-charts/infisical-standalone-postgres/templates/jobs-rbac.yamlindex fa7651e716..04d66f3d4d 100644--- a/helm-charts/infisical-standalone-postgres/templates/jobs-rbac.yaml+++ b/helm-charts/infisical-standalone-postgres/templates/jobs-rbac.yaml@@ -2,6 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata:name: k8s-wait-for-infisical-schema-migration+ namespace: {{ .Release.Namespace }}rules:- apiGroups: ["batch"]resources: ["jobs"]@@ -10,11 +11,12 @@ rules:apiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata:- name: default+ name: infisical-database-schema-migration+ namespace: {{ .Release.Namespace }}subjects:- kind: ServiceAccount- name: default- namespace: {{ .Release.Namespace }}+ name: {{ .Values.infisical.databaseSchemaMigrationJob.serviceAccountName | default "default" }}+ namespace: {{ .Values.infisical.databaseSchemaMigrationJob.serviceAccountNamespace | default .Release.Namespace }}roleRef:kind: Rolename: k8s-wait-for-infisical-schema-migrationdiff --git a/helm-charts/infisical-standalone-postgres/templates/schema-migration-job.yaml b/helm-charts/infisical-standalone-postgres/templates/schema-migration-job.yamlindex 40cd0bc9b9..06a1f840b5 100644--- a/helm-charts/infisical-standalone-postgres/templates/schema-migration-job.yaml+++ b/helm-charts/infisical-standalone-postgres/templates/schema-migration-job.yaml@@ -16,6 +16,7 @@ spec:app.kubernetes.io/instance: {{ .Release.Name | quote }}helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"spec:+ serviceAccountName: {{ .Values.infisical.databaseSchemaMigrationJob.serviceAccountName | default "default" }}{{- if $infisicalValues.image.imagePullSecrets }}imagePullSecrets:{{- toYaml $infisicalValues.image.imagePullSecrets | nindent 6 }}@@ -26,6 +27,13 @@ spec:image: "{{ $infisicalValues.image.repository }}:{{ $infisicalValues.image.tag }}"command: ["npm", "run", "migration:latest"]env:+ {{- if .Values.postgresql.useExistingPostgresSecret.enabled }}+ - name: DB_CONNECTION_URI+ valueFrom:+ secretKeyRef:+ name: {{ .Values.postgresql.useExistingPostgresSecret.existingConnectionStringSecret.name }}+ key: {{ .Values.postgresql.useExistingPostgresSecret.existingConnectionStringSecret.key }}+ {{- end }}{{- if .Values.postgresql.enabled }}- name: DB_CONNECTION_URIvalue: {{ include "infisical.postgresDBConnectionString" . }}diff --git a/helm-charts/infisical-standalone-postgres/values.yaml b/helm-charts/infisical-standalone-postgres/values.yamlindex 3f43e4a61c..eefe7beb39 100644--- a/helm-charts/infisical-standalone-postgres/values.yaml+++ b/helm-charts/infisical-standalone-postgres/values.yaml@@ -5,6 +5,10 @@ infisical:enabled: truename: infisicalautoDatabaseSchemaMigration: true+ databaseSchemaMigrationJob:+ serviceAccountNamespace: default+ serviceAccountName: default+fullnameOverride: ""podAnnotations: {}deploymentAnnotations: {}@@ -18,6 +22,7 @@ infisical:affinity: {}kubeSecretRef: "infisical-secrets"+service:annotations: {}type: ClusterIP@@ -43,6 +48,7 @@ ingress:# - some.domain.compostgresql:+ # -- When enabled, this will start up a in cluster Postgresenabled: truename: "postgresql"fullnameOverride: "postgresql"@@ -50,6 +56,15 @@ postgresql:username: infisicalpassword: rootdatabase: infisicalDB+ useExistingPostgresSecret:+ # -- When this is enabled, postgresql.enabled needs to be false+ enabled: false+ # -- The name from where to get the existing postgresql connection string+ existingConnectionStringSecret:+ # -- The name of the secret that contains the postgres connection string+ name: ""+ # -- Secret key name that contains the postgres connection string+ key: ""redis:enabled: true