Files
Aleksei SviridkinandMatthieu ROBIN af86c9d5b8 feat(cozy-lib): instance-type preset names with five series and legacy aliases
Restructure the resource preset table into a flat <series>.<size> naming
convention inspired by KubeVirt and cloud-provider instance types. Five
series cover the full CPU-to-memory ratio range:

  t1 (Tiny,      1:0.5) — burstable, low memory
  c1 (Compute,   1:1)   — CPU-balanced, CPU-bound workloads
  s1 (Standard,  1:2)   — proxies, caches, lightweight services
  u1 (Universal, 1:4)   — databases and messaging
  m1 (Memory,    1:8)   — search and analytics

Each series provides eight sizes (nano, micro, small, medium, large,
xlarge, 2xlarge, 4xlarge), yielding 40 presets in total. Ephemeral
storage remains 2Gi for every preset.

The seven legacy flat names (nano, micro, small, medium, large, xlarge,
2xlarge) are retained as backward-compatibility aliases returning their
original CPU and memory values. Existing HelmReleases and app CRs
continue to render identical resources without a migration step. The
legacy block is deprecated and will be removed in a future release; the
1:1 conversion table is:

  nano    -> t1.nano       (250m / 128Mi)
  micro   -> t1.micro      (500m / 256Mi)
  small   -> t1.small      (1    / 512Mi)
  medium  -> c1.small      (1    / 1Gi)
  large   -> c1.medium     (2    / 2Gi)
  xlarge  -> c1.large      (4    / 4Gi)
  2xlarge -> c1.xlarge     (8    / 8Gi)

Also fix the preset helper docstring to pass the preset string straight
to unsanitizedPreset, replacing the prior list applied-to-tuple form
that silently invoked the dot value as a function.

Co-authored-by: Matthieu ROBIN <matthieu@hidora.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-05-11 21:08:13 +03:00
..