Skip to content

Commit b66e15b

Browse files
committed
docs(resource-management): instance-type resource presets
Update the resource-management guide to describe the new `<series>.<size>` instance-type preset scheme: - five series (t1, c1, s1, u1, m1) covering CPU:memory ratios from 1:0.5 to 1:8 - eight sizes (nano through 4xlarge) per series - explicit callout that legacy `medium` (1 CPU / 1Gi) and new `*.medium` (2 CPU) names overlap but resources do not - 1:1 legacy-to-instance-type mapping table for the seven deprecated flat names that remain accepted as aliases - mention of the API-server deprecation warning and the platform upgrade migration that rewrites stored values Also correct CPU values in the prior table that disagreed with the actual cozy-lib library (nano was listed as 100m / 128Mi but cozy-lib has always rendered 250m / 128Mi for nano, and so on for every row); pin the table on the values cozy-lib actually returns. Track corresponding code change at cozystack/cozystack#2607. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 6ded60e commit b66e15b

1 file changed

Lines changed: 48 additions & 12 deletions

File tree

  • content/en/docs/next/guides/resource-management

‎content/en/docs/next/guides/resource-management/_index.md‎

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,60 @@ When deploying a service, a preset is defined in `resourcesPreset` configuration
3333

3434
```yaml
3535
## @param resourcesPreset Default sizing preset used when `resources` is omitted.
36-
## Allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge.
37-
resourcesPreset: "small"
36+
resourcesPreset: "t1.small"
3837
```
3938
40-
| Preset name | CPU | memory |
41-
|-------------|--------|---------|
42-
| `nano` | `100m` | `128Mi` |
43-
| `micro` | `250m` | `256Mi` |
44-
| `small` | `500m` | `512Mi` |
45-
| `medium` | `500m` | `1Gi` |
46-
| `large` | `1` | `2Gi` |
47-
| `xlarge` | `2` | `4Gi` |
48-
| `2xlarge` | `4` | `8Gi` |
39+
Presets follow a cloud-style `<series>.<size>` naming convention. Five series cover the full CPU-to-memory ratio range, and each series ships eight sizes (`nano` through `4xlarge`):
40+
41+
| Series | Ratio CPU:Mem | Typical use case |
42+
| ------ | ------------- | ------------------------------------------------- |
43+
| `t1` | 1:0.5 | Tiny / burstable, low memory |
44+
| `c1` | 1:1 | Compute-balanced, CPU-bound workloads |
45+
| `s1` | 1:2 | Standard — proxies, caches, lightweight services |
46+
| `u1` | 1:4 | Universal — databases and messaging |
47+
| `m1` | 1:8 | Memory-heavy — search, analytics, large caches |
48+
49+
CPU per size:
50+
51+
| Size | CPU |
52+
| ---------- | ---- |
53+
| `nano` | 250m |
54+
| `micro` | 500m |
55+
| `small` | 1 |
56+
| `medium` | 2 |
57+
| `large` | 4 |
58+
| `xlarge` | 8 |
59+
| `2xlarge` | 16 |
60+
| `4xlarge` | 32 |
61+
62+
Memory follows from the series ratio. For example, `t1.small` is 1 CPU / 512Mi, `c1.small` is 1 CPU / 1Gi, `s1.small` is 1 CPU / 2Gi, `u1.small` is 1 CPU / 4Gi, and `m1.small` is 1 CPU / 8Gi. Ephemeral storage is 2Gi for every preset.
4963

5064
In CPU, the `m` unit is 1/1000th of a full CPU time.
5165

66+
#### Watch out: legacy and instance-type `medium` differ
67+
68+
The legacy flat preset `medium` had **1 CPU / 1Gi**. The new `*.medium` sizes have **2 CPU**. The names overlap but the resources do not. The legacy table below stays correct — `medium → c1.small (1 CPU / 1Gi)` — but if you read the instance-type sizing matrix first and pick `c1.medium` "to keep things the same as before", you will double your CPU. When in doubt, consult the legacy-to-instance-type mapping below.
69+
70+
#### Legacy flat preset names (deprecated)
71+
72+
The seven short names that existed before the instance-type rename remain accepted as backward-compatibility aliases. They render exactly the CPU and memory they did before — so an existing HelmRelease or app CR continues to behave identically. The 1:1 mapping is:
73+
74+
| Legacy | CPU | Memory | Instance-type equivalent |
75+
| -------- | ---- | ------ | ------------------------ |
76+
| `nano` | 250m | 128Mi | `t1.nano` |
77+
| `micro` | 500m | 256Mi | `t1.micro` |
78+
| `small` | 1 | 512Mi | `t1.small` |
79+
| `medium` | 1 | 1Gi | `c1.small` |
80+
| `large` | 2 | 2Gi | `c1.medium` |
81+
| `xlarge` | 4 | 4Gi | `c1.large` |
82+
| `2xlarge`| 8 | 8Gi | `c1.xlarge` |
83+
84+
Legacy names are scheduled for removal in a future Cozystack release; new manifests should use the instance-type form. The Cozystack API server logs a deprecation warning whenever an app CR carries a legacy value, naming the suggested replacement.
85+
86+
A platform upgrade runs a one-shot migration (Migration 39) that walks every `HelmRelease.spec.values` and every app CR under `apps.cozystack.io/v1alpha1` and rewrites legacy values to their instance-type equivalents in place. The conversion is idempotent, best-effort, and never changes CPU or memory.
87+
5288
Cozystack presets are defined in an internal library
53-
[`cozy-lib`](https://github.com/cozystack/cozystack/tree/main/packages/library/cozy-lib).
89+
[`cozy-lib`](https://github.com/cozystack/cozystack/tree/main/packages/library/cozy-lib). The canonical reference, including the full size matrix and migration table, lives in [`docs/operations/resource-presets.md`](https://github.com/cozystack/cozystack/blob/main/docs/operations/resource-presets.md).
5490

5591

5692
### Defining Resources Explicitly

0 commit comments

Comments
 (0)