Skip to content

Commit 148d699

Browse files
Merge branch 'main' into fix/stable-source-ref
2 parents c38351f + 514a77a commit 148d699

1 file changed

Lines changed: 67 additions & 27 deletions

File tree

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

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

Lines changed: 67 additions & 27 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
@@ -66,7 +102,7 @@ resources:
66102
memory: 2Gi
67103
```
68104
69-
If both `resources` and `resourcesPreset` are defined, `resource` is used and `resourcsePreset` is ignored.
105+
If both `resources` and `resourcesPreset` are defined, `resources` is used and `resourcesPreset` is ignored.
70106

71107

72108
## Resource Requests and Limits
@@ -133,27 +169,31 @@ resources:
133169
134170
### Example 1, default setting: `cpu-allocation-ratio: 10`
135171

172+
Preset CPU shown for the `t1` series (the legacy `nano … 2xlarge` aliases use the same CPU values; other series share the same `cpu` column per size, so a `c1.small`, `s1.small`, `u1.small`, or `m1.small` each have `cpu: 1` too).
173+
136174
| Preset name | `resources.cpu` | actual CPU request | actual CPU limit |
137175
|-------------|-----------------|--------------------|------------------|
138-
| `nano` | `100m` | `10m` | `100m` |
139-
| `micro` | `250m` | `25m` | `250m` |
140-
| `small` | `500m` | `50m` | `500m` |
141-
| `medium` | `500m` | `50m` | `500m` |
142-
| `large` | `1` | `100m` | `1` |
143-
| `xlarge` | `2` | `200m` | `2` |
144-
| `2xlarge` | `4` | `400m` | `4` |
176+
| `t1.nano` | `250m` | `25m` | `250m` |
177+
| `t1.micro` | `500m` | `50m` | `500m` |
178+
| `t1.small` | `1` | `100m` | `1` |
179+
| `t1.medium` | `2` | `200m` | `2` |
180+
| `t1.large` | `4` | `400m` | `4` |
181+
| `t1.xlarge` | `8` | `800m` | `8` |
182+
| `t1.2xlarge`| `16` | `1600m` | `16` |
183+
| `t1.4xlarge`| `32` | `3200m` | `32` |
145184

146185
### Example 2: `cpu-allocation-ratio: 4`
147186

148187
| Preset name | `resources.cpu` | actual CPU request | actual CPU limit |
149188
|-------------|-----------------|--------------------|------------------|
150-
| `nano` | `100m` | `25m` | `100m` |
151-
| `micro` | `250m` | `63m` | `250m` |
152-
| `small` | `500m` | `125m` | `500m` |
153-
| `medium` | `500m` | `125m` | `500m` |
154-
| `large` | `1` | `250m` | `1` |
155-
| `xlarge` | `2` | `500m` | `2` |
156-
| `2xlarge` | `4` | `1` | `4` |
189+
| `t1.nano` | `250m` | `62m` | `250m` |
190+
| `t1.micro` | `500m` | `125m` | `500m` |
191+
| `t1.small` | `1` | `250m` | `1` |
192+
| `t1.medium` | `2` | `500m` | `2` |
193+
| `t1.large` | `4` | `1` | `4` |
194+
| `t1.xlarge` | `8` | `2` | `8` |
195+
| `t1.2xlarge`| `16` | `4` | `16` |
196+
| `t1.4xlarge`| `32` | `8` | `32` |
157197

158198
## Configuration Format Before v0.31.0
159199

0 commit comments

Comments
 (0)