Skip to content

feat(chart): add optional HorizontalPodAutoscaler for php-fpm and nginx - #176

Open
danielqb wants to merge 1 commit into
eftechcombr:mainfrom
danielqb:clean/horizontal-pod-autoscaler
Open

feat(chart): add optional HorizontalPodAutoscaler for php-fpm and nginx#176
danielqb wants to merge 1 commit into
eftechcombr:mainfrom
danielqb:clean/horizontal-pod-autoscaler

Conversation

@danielqb

Copy link
Copy Markdown

Problem

Neither php-fpm nor nginx could scale automatically based on load; only
a fixed replicaCount was supported.

Fix

  • Added templates/glpi-hpa.yaml with independent autoscaling/v2 HPAs for
    php-fpm and nginx, each gated behind its own autoscaling.enabled
    (default false). Supports CPU and/or memory utilization targets
    (either can be left empty to omit that metric).
  • glpi-deployment.yaml now omits the replicas field entirely when
    autoscaling.enabled is true for that component, so helm upgrade
    doesn't fight the HPA by resetting replicas back to replicaCount on
    every release (a well-known Helm+HPA footgun otherwise).
  • Documented the shared-storage caveat directly in values.yaml: scaling
    php-fpm beyond 1 replica requires glpi.persistence.files to use a
    ReadWriteMany-capable storageClass, since GLPI_VAR_DIR (uploads,
    sessions) is read/written by every replica.

Testing

  • helm lint: 0 failures
  • helm template (default): no HPA rendered, Deployments still set
    replicas: 1 explicitly
  • helm template --set glpi.phpfpm.autoscaling.enabled=true --set
    glpi.nginx.autoscaling.enabled=true: both HPAs render targeting the
    correct Deployment names; Deployments no longer set replicas at all

## Problem

Neither php-fpm nor nginx could scale automatically based on load; only
a fixed replicaCount was supported.

## Fix

- Added templates/glpi-hpa.yaml with independent autoscaling/v2 HPAs for
  php-fpm and nginx, each gated behind its own `autoscaling.enabled`
  (default false). Supports CPU and/or memory utilization targets
  (either can be left empty to omit that metric).
- glpi-deployment.yaml now omits the `replicas` field entirely when
  autoscaling.enabled is true for that component, so `helm upgrade`
  doesn't fight the HPA by resetting replicas back to replicaCount on
  every release (a well-known Helm+HPA footgun otherwise).
- Documented the shared-storage caveat directly in values.yaml: scaling
  php-fpm beyond 1 replica requires glpi.persistence.files to use a
  ReadWriteMany-capable storageClass, since GLPI_VAR_DIR (uploads,
  sessions) is read/written by every replica.

## Testing

- helm lint: 0 failures
- helm template (default): no HPA rendered, Deployments still set
  `replicas: 1` explicitly
- helm template --set glpi.phpfpm.autoscaling.enabled=true --set
  glpi.nginx.autoscaling.enabled=true: both HPAs render targeting the
  correct Deployment names; Deployments no longer set `replicas` at all

@eduardofraga eduardofraga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move files from kubernetes/glpi to helm/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants