Skip to content

Commit dc2ced2

Browse files
committed
fix(chart): remove unused volume mounts and DB secret from nginx container
## Problem The nginx container in glpi-deployment.yaml mounted the files, marketplace, and etc PersistentVolumeClaims (ReadWriteOnce) even though nginx's actual config (default.conf) never reads from those paths - it only serves static assets from /var/www/html/public (baked into the image) and proxies everything else to php-fpm via fastcgi_pass. It also pulled glpi-secret (DB credentials) via envFrom despite never connecting to the database. Since both nginx and php-fpm mounted the same RWO PVCs, a cluster without explicit pod affinity forcing them onto the same node could schedule them on different nodes, causing FailedMount/ContainerCreating for whichever pod lands second. ## Fix Removed the files/marketplace/etc volumeMounts and volumes, and the glpi-secret envFrom, from the nginx container. Only php-fpm (which is the only container that actually touches GLPI_VAR_DIR/marketplace/etc and the database) keeps these. nginx now only mounts nginx-conf. This also reduces blast radius: nginx no longer has DB credentials in its environment (least privilege). ## Testing - helm lint: 0 failures - helm template: nginx Deployment renders with only nginx-conf volume, no envFrom block
1 parent ad5ec68 commit dc2ced2

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

kubernetes/glpi/templates/glpi-deployment.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,10 @@ spec:
159159
securityContext:
160160
{{- toYaml . | nindent 12 }}
161161
{{- end }}
162-
envFrom:
163-
- configMapRef:
164-
name: glpi-config
165-
- secretRef:
166-
name: glpi-secret
167162
ports:
168163
- containerPort: 8080
169164
name: http
170165
volumeMounts:
171-
- name: files
172-
mountPath: /var/lib/glpi
173-
- name: marketplace
174-
mountPath: /var/www/html/marketplace
175-
- name: etc
176-
mountPath: /etc/glpi
177166
- name: nginx-conf
178167
mountPath: /etc/nginx/conf.d
179168
{{- if .Values.glpi.nginx.livenessProbe.enabled }}
@@ -199,15 +188,6 @@ spec:
199188
resources:
200189
{{- toYaml .Values.glpi.nginx.resources | nindent 12 }}
201190
volumes:
202-
- name: etc
203-
persistentVolumeClaim:
204-
claimName: glpi-etc
205-
- name: files
206-
persistentVolumeClaim:
207-
claimName: glpi-files
208-
- name: marketplace
209-
persistentVolumeClaim:
210-
claimName: glpi-marketplace
211191
- name: nginx-conf
212192
configMap:
213193
defaultMode: 420

0 commit comments

Comments
 (0)