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
swap back to split PVCs
x032205c429a67a95c0
diff --git a/helm-charts/infisical-gateway/templates/deployment.yaml b/helm-charts/infisical-gateway/templates/deployment.yamlindex 7e8f50afe8..1201799e89 100644--- a/helm-charts/infisical-gateway/templates/deployment.yaml+++ b/helm-charts/infisical-gateway/templates/deployment.yaml@@ -1,5 +1,6 @@-{{- $usePVC := and .Values.persistence.enabled (or .Values.gateway.enrollment.method .Values.persistence.existingClaim) }}{{- $sessionPath := .Values.gateway.pamSessionRecordingsDirectory | default "/var/lib/infisical/session_recordings" }}+{{- $persistCredentials := and .Values.persistence.enabled .Values.gateway.enrollment.method }}+{{- $persistSessionRecordings := and .Values.persistence.enabled (or .Values.gateway.enrollment.method .Values.persistence.sessionRecording.existingClaim) }}{{- if eq .Values.gateway.enrollment.method "token" }}{{- if not .Values.persistence.enabled }}{{- fail "persistence.enabled must be true when gateway.enrollment.method is 'token'. The enrollment token is single-use and credentials must persist across pod restarts." }}@@ -18,7 +19,7 @@ spec:{{- if .Values.gateway.enrollment.method }}replicas: 1{{- end }}- {{- if $usePVC }}+ {{- if or $persistCredentials $persistSessionRecordings }}strategy:type: Recreate{{- end }}@@ -47,17 +48,22 @@ spec:{{- toYaml . | nindent 8 }}{{- end }}volumes:- {{- if $usePVC }}- - name: gateway-data+ {{- if .Values.gateway.enrollment.method }}+ - name: gateway-credentials+ {{- if $persistCredentials }}persistentVolumeClaim:claimName: {{ .Values.persistence.existingClaim | default (printf "%s-credentials" (include "infisical-gateway.fullname" .)) }}- {{- else if .Values.gateway.enrollment.method }}- - name: gateway-credentials+ {{- else }}emptyDir: {}+ {{- end }}{{- end }}- name: infisical-cacheemptyDir: {}- {{- if and (not $usePVC) (not (hasPrefix "/var/lib/infisical" $sessionPath)) }}+ {{- if $persistSessionRecordings }}+ - name: session-recordings+ persistentVolumeClaim:+ claimName: {{ .Values.persistence.sessionRecording.existingClaim | default (printf "%s-session-recordings" (include "infisical-gateway.fullname" .)) }}+ {{- else if not (hasPrefix "/var/lib/infisical" $sessionPath) }}- name: session-recordingsemptyDir: {}{{- end }}@@ -100,23 +106,13 @@ spec:{{- if .Values.gateway.relayName }}- --target-relay-name={{ .Values.gateway.relayName }}{{- end }}- - --pam-session-recording-path={{ .Values.gateway.pamSessionRecordingsDirectory | default "/var/lib/infisical/session_recordings" }}+ - --pam-session-recording-path={{ $sessionPath }}volumeMounts:- {{- if $usePVC }}- - name: gateway-data- mountPath: /home/infisical- subPath: credentials- {{- else }}- name: gateway-credentialsmountPath: /home/infisical- {{- end }}- name: infisical-cachemountPath: /var/lib/infisical- {{- if $usePVC }}- - name: gateway-data- mountPath: {{ $sessionPath }}- subPath: session-recordings- {{- else if not (hasPrefix "/var/lib/infisical" $sessionPath) }}+ {{- if or $persistSessionRecordings (not (hasPrefix "/var/lib/infisical" $sessionPath)) }}- name: session-recordingsmountPath: {{ $sessionPath }}{{- end }}@@ -124,7 +120,7 @@ spec:args:- gateway- start- - --pam-session-recording-path={{ .Values.gateway.pamSessionRecordingsDirectory | default "/var/lib/infisical/session_recordings" }}+ - --pam-session-recording-path={{ $sessionPath }}envFrom:- secretRef:name: {{ .Values.secret.name }}@@ -135,11 +131,7 @@ spec:volumeMounts:- name: infisical-cachemountPath: /var/lib/infisical- {{- if $usePVC }}- - name: gateway-data- mountPath: {{ $sessionPath }}- subPath: session-recordings- {{- else if not (hasPrefix "/var/lib/infisical" $sessionPath) }}+ {{- if or $persistSessionRecordings (not (hasPrefix "/var/lib/infisical" $sessionPath)) }}- name: session-recordingsmountPath: {{ $sessionPath }}{{- end }}diff --git a/helm-charts/infisical-gateway/templates/pvc.yaml b/helm-charts/infisical-gateway/templates/pvc.yamlindex 137c5dd15d..3eb1d86b37 100644--- a/helm-charts/infisical-gateway/templates/pvc.yaml+++ b/helm-charts/infisical-gateway/templates/pvc.yaml@@ -2,7 +2,6 @@apiVersion: v1kind: PersistentVolumeClaimmetadata:- # Named -credentials for backwards compatibility with chart <=1.1.0. Also stores session recordings via subPath.name: {{ include "infisical-gateway.fullname" . }}-credentialslabels:{{- include "infisical-gateway.labels" . | nindent 4 }}@@ -16,3 +15,21 @@ spec:requests:storage: {{ .Values.persistence.size | quote }}{{- end }}+---+{{- if and .Values.gateway.enrollment.method .Values.persistence.enabled (not .Values.persistence.sessionRecording.existingClaim) }}+apiVersion: v1+kind: PersistentVolumeClaim+metadata:+ name: {{ include "infisical-gateway.fullname" . }}-session-recordings+ labels:+ {{- include "infisical-gateway.labels" . | nindent 4 }}+spec:+ accessModes:+ {{- toYaml .Values.persistence.sessionRecording.accessModes | nindent 4 }}+ {{- if .Values.persistence.sessionRecording.storageClass }}+ storageClassName: {{ .Values.persistence.sessionRecording.storageClass | quote }}+ {{- end }}+ resources:+ requests:+ storage: {{ .Values.persistence.sessionRecording.size | quote }}+{{- end }}diff --git a/helm-charts/infisical-gateway/values.yaml b/helm-charts/infisical-gateway/values.yamlindex a1f0c3b0be..fc776fe67f 100644--- a/helm-charts/infisical-gateway/values.yaml+++ b/helm-charts/infisical-gateway/values.yaml@@ -48,13 +48,21 @@ gateway:# Controls both credential storage (enrollment flow) and session recordings.# Required when enrollment.method=token so credentials survive pod restarts.# Optional when enrollment.method=aws since it re-authenticates via STS on every start.+# For legacy machine-identity installs (no enrollment.method), persistence only takes effect+# for session recordings when sessionRecording.existingClaim is provided.persistence:enabled: truestorageClass: ""- size: 5Gi+ size: 100MiaccessModes:- ReadWriteOnceexistingClaim: ""+ sessionRecording:+ size: 5Gi+ storageClass: ""+ accessModes:+ - ReadWriteOnce+ existingClaim: ""resources:limits: