1717
1818 spec :
1919 containers :
20+ # sidecar: GUI connects to localhost:8202 (vault-agent)
21+ {{- if .Values.vaultAgent.enabled }}
22+ - name : vault-agent-gui
23+ image : hashicorp/vault:1.20.3
24+ command : ["vault", "agent", "-config=/agent/config/gui-agent.hcl", "-log-level=info"]
25+ ports :
26+ - name : agent-api
27+ containerPort : 8202
28+ protocol : TCP
29+ volumeMounts :
30+ - name : vault-agent-config
31+ mountPath : /agent/config
32+ readOnly : true
33+ - name : vault-agent-creds
34+ mountPath : /agent/credentials
35+ readOnly : true
36+ - name : vault-agent-gui-token
37+ mountPath : /agent/gui-token
38+ securityContext :
39+ capabilities :
40+ add : ["IPC_LOCK"]
41+ # # Health check: Ensure token file exists and is not empty
42+ # livenessProbe:
43+ # exec:
44+ # command:
45+ # - sh
46+ # - -c
47+ # - test -f /agent/gui-token/token && test -s /agent/gui-token/token
48+ # initialDelaySeconds: 10
49+ # periodSeconds: 10
50+ # timeoutSeconds: 3
51+ # failureThreshold: 3
52+ # readinessProbe:
53+ # exec:
54+ # command:
55+ # - sh
56+ # - -c
57+ # - test -f /agent/gui-token/token && test -s /agent/gui-token/token
58+ # initialDelaySeconds: 5
59+ # periodSeconds: 5
60+ # timeoutSeconds: 3
61+ {{- end }}
2062 - name : {{ .Values.gui.release_name }}
2163 image : " {{ .Values.gui.image.repository }}:{{ .Values.gui.image.tag }}"
2264 imagePullPolicy : {{ .Values.gui.image.pullPolicy }}
@@ -51,13 +93,24 @@ spec:
5193 value : {{ .Values.gui.serviceId | quote }}
5294 - name : REACT_APP_ENABLE_HIDDEN_FEATURES
5395 value : {{ .Values.gui.enableHiddenFeatures | quote | upper }}
96+
97+ {{- if .Values.vaultAgent.enabled }}
98+ # Vault Agent proxy URL (localhost sidecar)
99+ - name : VAULT_AGENT_URL
100+ value : " http://localhost:8202"
101+ {{- end }}
54102
55103 # Vite development server configuration
56104 - name : VITE_HOST
57105 value : {{ .Values.gui.vite.host | quote }}
58106 - name : VITE_ALLOWED_HOSTS
59107 value : {{ .Values.gui.vite.allowedHosts | quote }}
60108
109+ volumeMounts :
110+ - name : vite-config
111+ mountPath : /app/vite.config.ts
112+ subPath : vite.config.ts
113+
61114 resources :
62115 limits :
63116 cpu : {{ .Values.gui.resources.limits.cpu }}
@@ -82,6 +135,25 @@ spec:
82135 # periodSeconds: 5
83136 # timeoutSeconds: 3
84137
138+ volumes :
139+ - name : vite-config
140+ configMap :
141+ name : {{ .Values.gui.release_name }}-vite-config
142+ {{- if .Values.vaultAgent.enabled }}
143+ # Vault Agent configuration (from Vault-Agent-GUI chart)
144+ - name : vault-agent-config
145+ configMap :
146+ name : vault-agent-gui-config
147+ # Shared AppRole credentials (created by vault-init Job)
148+ - name : vault-agent-creds
149+ persistentVolumeClaim :
150+ claimName : vault-agent-creds
151+ # GUI-specific token storage (pod-scoped, short-lived)
152+ # Tokens are generated by Vault Agent and destroyed when pod terminates
153+ - name : vault-agent-gui-token
154+ emptyDir : {}
155+ {{- end }}
156+
85157 restartPolicy : Always
86158
87159{{- end }}
0 commit comments