Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

pivot back to single PVC yet again

x032205c904db84ca60
diff --git a/helm-charts/infisical-gateway/templates/deployment.yaml b/helm-charts/infisical-gateway/templates/deployment.yaml
index 1201799e89..6f615c5fa9 100644
--- a/helm-charts/infisical-gateway/templates/deployment.yaml
+++ b/helm-charts/infisical-gateway/templates/deployment.yaml
@@ -1,6 +1,5 @@
{{- $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) }}
+{{- $usePVC := and .Values.persistence.enabled (or .Values.gateway.enrollment.method .Values.persistence.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." }}
@@ -19,7 +18,7 @@ spec:
{{- if .Values.gateway.enrollment.method }}
replicas: 1
{{- end }}
- {{- if or $persistCredentials $persistSessionRecordings }}
+ {{- if $usePVC }}
strategy:
type: Recreate
{{- end }}
@@ -48,22 +47,17 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- {{- if .Values.gateway.enrollment.method }}
- - name: gateway-credentials
- {{- if $persistCredentials }}
+ {{- if $usePVC }}
+ - name: gateway-data
persistentVolumeClaim:
- claimName: {{ .Values.persistence.existingClaim | default (printf "%s-credentials" (include "infisical-gateway.fullname" .)) }}
- {{- else }}
+ claimName: {{ .Values.persistence.existingClaim | default (printf "%s-data" (include "infisical-gateway.fullname" .)) }}
+ {{- else if .Values.gateway.enrollment.method }}
+ - name: gateway-credentials
emptyDir: {}
- {{- end }}
{{- end }}
- name: infisical-cache
emptyDir: {}
- {{- 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) }}
+ {{- if and (not $usePVC) (not (hasPrefix "/var/lib/infisical" $sessionPath)) }}
- name: session-recordings
emptyDir: {}
{{- end }}
@@ -108,11 +102,21 @@ spec:
{{- end }}
- --pam-session-recording-path={{ $sessionPath }}
volumeMounts:
+ {{- if $usePVC }}
+ - name: gateway-data
+ mountPath: /home/infisical
+ subPath: credentials
+ {{- else }}
- name: gateway-credentials
mountPath: /home/infisical
+ {{- end }}
- name: infisical-cache
mountPath: /var/lib/infisical
- {{- if or $persistSessionRecordings (not (hasPrefix "/var/lib/infisical" $sessionPath)) }}
+ {{- if $usePVC }}
+ - name: gateway-data
+ mountPath: {{ $sessionPath }}
+ subPath: session-recordings
+ {{- else if not (hasPrefix "/var/lib/infisical" $sessionPath) }}
- name: session-recordings
mountPath: {{ $sessionPath }}
{{- end }}
@@ -131,7 +135,11 @@ spec:
volumeMounts:
- name: infisical-cache
mountPath: /var/lib/infisical
- {{- if or $persistSessionRecordings (not (hasPrefix "/var/lib/infisical" $sessionPath)) }}
+ {{- if $usePVC }}
+ - name: gateway-data
+ mountPath: {{ $sessionPath }}
+ subPath: session-recordings
+ {{- else if not (hasPrefix "/var/lib/infisical" $sessionPath) }}
- name: session-recordings
mountPath: {{ $sessionPath }}
{{- end }}
diff --git a/helm-charts/infisical-gateway/templates/pvc.yaml b/helm-charts/infisical-gateway/templates/pvc.yaml
index 3eb1d86b37..01beff8c55 100644
--- a/helm-charts/infisical-gateway/templates/pvc.yaml
+++ b/helm-charts/infisical-gateway/templates/pvc.yaml
@@ -2,7 +2,7 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
- name: {{ include "infisical-gateway.fullname" . }}-credentials
+ name: {{ include "infisical-gateway.fullname" . }}-data
labels:
{{- include "infisical-gateway.labels" . | nindent 4 }}
spec:
@@ -15,21 +15,3 @@ 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.yaml
index fc776fe67f..3515f71d1d 100644
--- a/helm-charts/infisical-gateway/values.yaml
+++ b/helm-charts/infisical-gateway/values.yaml
@@ -44,25 +44,18 @@ gateway:
pamSessionRecordingsDirectory: /var/lib/infisical/session_recordings
-# Persistent storage for the gateway.
-# Controls both credential storage (enrollment flow) and session recordings.
+# Persistent storage for the gateway (credentials 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.
+# when existingClaim is provided.
persistence:
enabled: true
storageClass: ""
- size: 100Mi
+ size: 5Gi
accessModes:
- ReadWriteOnce
existingClaim: ""
- sessionRecording:
- size: 5Gi
- storageClass: ""
- accessModes:
- - ReadWriteOnce
- existingClaim: ""
resources:
limits: