Skip to content

feat(chart): add resourcesPreset support (Bitnami-style resource tiers) - #174

Open
danielqb wants to merge 1 commit into
eftechcombr:mainfrom
danielqb:clean/resources-preset
Open

feat(chart): add resourcesPreset support (Bitnami-style resource tiers)#174
danielqb wants to merge 1 commit into
eftechcombr:mainfrom
danielqb:clean/resources-preset

Conversation

@danielqb

Copy link
Copy Markdown

Resources for php-fpm, nginx, mariadb, and redis were only configurable
as full explicit request/limit blocks. Bitnami charts offer a lighter-weight
alternative via a resourcesPreset value (none/nano/micro/small/medium/
large/xlarge/2xlarge) that maps to a predefined table, useful for quick
sizing without hand-writing CPU/memory numbers.

  • Added glpi.resources.preset helper in _helpers.tpl with the same
    tiers/values as bitnami/common's common.resources.preset, so operators
    already familiar with that convention get predictable numbers here.

  • Added glpi.resources helper: renders the explicit resources dict if
    non-empty, otherwise falls back to resourcesPreset (renders nothing
    if both are unset/none).

  • Added resourcesPreset: "none" alongside the existing resources blocks
    for glpi.phpfpm, glpi.nginx, mariadb.primary, and redis in values.yaml.
    Existing concrete resources values are UNCHANGED and still take
    precedence by default - this is purely additive, zero behavior change
    unless a user explicitly clears resources to use a preset instead.

  • Updated glpi-deployment.yaml (php-fpm + nginx), mariadb-statefulset.yaml,
    and redis-deployment.yaml to use the new helper.

  • helm lint: 0 failures

  • helm template (default): resources unchanged (1000m/512Mi php-fpm,
    500m/256Mi nginx, matches pre-existing values)

  • helm template --set glpi.phpfpm.resources=null --set
    glpi.phpfpm.resourcesPreset=large: renders 1.5cpu/3072Mi limits,
    1.0cpu/2048Mi requests (matches Bitnami's "large" tier)

  • helm template --set redis.resources=null (resourcesPreset stays
    "none" default): no resources block rendered at all

Resources for php-fpm, nginx, mariadb, and redis were only configurable
as full explicit request/limit blocks. Bitnami charts offer a lighter-weight
alternative via a resourcesPreset value (none/nano/micro/small/medium/
large/xlarge/2xlarge) that maps to a predefined table, useful for quick
sizing without hand-writing CPU/memory numbers.

- Added glpi.resources.preset helper in _helpers.tpl with the same
  tiers/values as bitnami/common's common.resources.preset, so operators
  already familiar with that convention get predictable numbers here.
- Added glpi.resources helper: renders the explicit `resources` dict if
  non-empty, otherwise falls back to `resourcesPreset` (renders nothing
  if both are unset/none).
- Added resourcesPreset: "none" alongside the existing resources blocks
  for glpi.phpfpm, glpi.nginx, mariadb.primary, and redis in values.yaml.
  Existing concrete resources values are UNCHANGED and still take
  precedence by default - this is purely additive, zero behavior change
  unless a user explicitly clears `resources` to use a preset instead.
- Updated glpi-deployment.yaml (php-fpm + nginx), mariadb-statefulset.yaml,
  and redis-deployment.yaml to use the new helper.

- helm lint: 0 failures
- helm template (default): resources unchanged (1000m/512Mi php-fpm,
  500m/256Mi nginx, matches pre-existing values)
- helm template --set glpi.phpfpm.resources=null --set
  glpi.phpfpm.resourcesPreset=large: renders 1.5cpu/3072Mi limits,
  1.0cpu/2048Mi requests (matches Bitnami's "large" tier)
- helm template --set redis.resources=null (resourcesPreset stays
  "none" default): no resources block rendered 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