Skip to content

fix(chart): remove unused volume mounts and DB secret from nginx container - #170

Open
danielqb wants to merge 1 commit into
eftechcombr:mainfrom
danielqb:fix/nginx-dead-volume-mounts
Open

fix(chart): remove unused volume mounts and DB secret from nginx container#170
danielqb wants to merge 1 commit into
eftechcombr:mainfrom
danielqb:fix/nginx-dead-volume-mounts

Conversation

@danielqb

Copy link
Copy Markdown

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

…ainer

## 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
@eduardofraga

Copy link
Copy Markdown
Contributor

This project requires RWX persistent volume claim because php-fpm and nginx access same volume.

@eduardofraga eduardofraga added the enhancement New feature or request label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants