Skip to content

Commit 4f6b3c6

Browse files
committed
fix(kubernetes): update README and tests to reflect ephemeralStorage silent-drop behavior
- README: replace outdated 'rendering will fail' warning with accurate description: ephemeralStorage is silently dropped and diskSize defaults to 20Gi; users with non-default sizes MUST set diskSize explicitly before upgrading to avoid disk pressure on next CAPI reconciliation. - cluster.yaml: revert coalesce back to '| default' — the operator fills diskSize from the schema default before the chart runs, so the ephemeralStorage fallback branch is structurally unreachable. - cluster_test.yaml: rename tests to honestly describe the silent-drop behavior; add storage value assertion to the empty-ephemeralStorage case. Signed-off-by: IvanHunters <[email protected]>
1 parent 66f0746 commit 4f6b3c6

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎packages/apps/kubernetes/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ See the reference for components utilized in this service:
8585

8686
## Breaking Changes
8787

88-
- **`ephemeralStorage` renamed to `diskSize`**: The `nodeGroups[name].ephemeralStorage` field has been renamed to `nodeGroups[name].diskSize` to better reflect its purpose (persistent disk for kubelet and containerd data). There is no backward-compatibility fallback; users MUST update their configurations to use `diskSize` instead of `ephemeralStorage`. If `ephemeralStorage` is still present in values, Helm template rendering will fail with an error directing you to use `diskSize`. When upgrading the CRD directly (bypassing Helm), the unrecognized field is silently dropped and kubelet storage reverts to the default 20Gi. Existing VMs will be automatically rolling-updated via CAPI when the new values are applied. State persists across same-VM reboots (virt-launcher restart, guest reboot, node failure); VM replacement by CAPI (e.g. nodeGroup field change, MachineHealthCheck remediation) provisions a fresh PVC.
88+
- **`ephemeralStorage` deprecated, silently ignored**: The `nodeGroups[name].ephemeralStorage` field has been renamed to `nodeGroups[name].diskSize`. Setting `ephemeralStorage` no longer blocks upgrades — Helm rendering succeeds — but the field is silently dropped and does **not** preserve the disk size. The operator fills `diskSize` from the schema default (`20Gi`) before the chart runs, so any `ephemeralStorage` value is unreachable. **Any cluster that previously set a non-default `ephemeralStorage` (e.g. `50Gi`) MUST explicitly set `diskSize` to the same value before upgrading**; otherwise the next reconciliation will provision `disk-kubelet` PVCs at `20Gi` and existing nodes may hit disk pressure or `ImagePullBackOff`. Existing VMs are automatically rolling-updated via CAPI when new values are applied. State persists across same-VM reboots; VM replacement by CAPI (e.g. MachineHealthCheck remediation) provisions a fresh PVC.
8989

9090
## Parameters
9191

‎packages/apps/kubernetes/templates/cluster.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
storage:
4444
resources:
4545
requests:
46-
storage: {{ coalesce .group.diskSize .group.ephemeralStorage "20Gi" | quote }}
46+
storage: {{ .group.diskSize | default "20Gi" | quote }}
4747
{{- with .group.storageClass }}
4848
storageClassName: {{ . | quote }}
4949
{{- end }}

‎packages/apps/kubernetes/tests/cluster_test.yaml‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ tests:
343343
# ephemeralStorage backward compatibility #
344344
###############################################
345345

346-
# diskSize defaults to 20Gi for all nodeGroups (schema required+default).
347-
# coalesce picks diskSize first; ephemeralStorage is a fallback only when
348-
# diskSize is absent (e.g. nodeGroup added by a future schema change).
349-
- it: uses diskSize default (20Gi) when ephemeralStorage is set alongside default diskSize
346+
# ephemeralStorage is silently dropped — the operator fills diskSize from the
347+
# schema default (20Gi) before the chart runs, so the user's ephemeralStorage
348+
# value is never reached. Users with non-default sizes MUST set diskSize explicitly.
349+
- it: ephemeralStorage is silently dropped — diskSize defaults to 20Gi regardless
350350
release:
351351
name: test-k8s
352352
namespace: tenant-test
@@ -359,14 +359,18 @@ tests:
359359
value: "20Gi"
360360
documentIndex: 5
361361

362-
- it: succeeds when ephemeralStorage is set to empty string
362+
- it: empty ephemeralStorage does not break rendering and diskSize stays at default 20Gi
363363
release:
364364
name: test-k8s
365365
namespace: tenant-test
366366
set:
367367
nodeGroups.md0.ephemeralStorage: ""
368368
asserts:
369369
- notFailedTemplate: {}
370+
- equal:
371+
path: spec.template.spec.virtualMachineTemplate.spec.dataVolumeTemplates[0].spec.storage.resources.requests.storage
372+
value: "20Gi"
373+
documentIndex: 5
370374

371375
- it: diskSize takes precedence over ephemeralStorage when both are explicitly set
372376
release:

0 commit comments

Comments
 (0)