mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
refactor(computeplane): stop copying pool defaults into the default md0
The default md0 pool wrote maxReplicas, instanceType and diskSize with
the same values the KubernetesNodes schema already defaults to, so the
pool's size lived in two places and would drift on the next change to
the pool defaults. The comment justifying the copy was wrong: the
reservation evaluator defaults stored values against the kind's own
schema, so a sparse release reserves the same as one with its defaults
written out.
md0 again names its cluster, the ingress role and the scale-from-zero
lower bound, and leaves its size to the pool defaults. The pool chart
renders byte-identical manifests from either set of values, so an
existing ComputePlane neither resizes nor rolls its default pool.
Fixes: a231f8d22b ("refactor(extra): write the ComputePlane default pool's size into its release")
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
2 files changed
+9
-30
No files matched your search
@@ -153,16 +153,10 @@ spec:
|
||||
md0 with roles: [ingress-nginx]; that default is gone with the split, so the
|
||||
module materialises the same md0 here, otherwise the pinned ingress-nginx
|
||||
addon would have no node to schedule onto and stay Pending forever.
|
||||
|
||||
The default md0 carries its whole size, not only what differs from the pool
|
||||
chart's defaults: those defaults live in the pool's schema and are never
|
||||
written into a release rendered here, so without them the release would not
|
||||
say what the pool can grow to, and a reservation read from it would have to
|
||||
know another chart's defaults.
|
||||
*/}}
|
||||
{{- $pools := .Values.nodeGroups }}
|
||||
{{- if not $pools }}
|
||||
{{- $pools = dict "md0" (dict "roles" (list "ingress-nginx") "minReplicas" 0 "maxReplicas" 10 "instanceType" "u1.medium" "diskSize" "20Gi") }}
|
||||
{{- $pools = dict "md0" (dict "roles" (list "ingress-nginx") "minReplicas" 0) }}
|
||||
{{- end }}
|
||||
{{- range $pool, $group := $pools }}
|
||||
---
|
||||
|
||||
@@ -116,30 +116,15 @@ tests:
|
||||
- equal:
|
||||
path: metadata.labels['apps.cozystack.io/application.name']
|
||||
value: computeplane-cluster-md0
|
||||
# The pool's size is left to the pool's own schema defaults, which
|
||||
# stay its single source.
|
||||
- equal:
|
||||
path: spec.values.cluster
|
||||
value: computeplane-cluster
|
||||
- equal:
|
||||
path: spec.values.clusterReleaseName
|
||||
value: computeplane-cluster
|
||||
- equal:
|
||||
path: spec.values.roles[0]
|
||||
value: ingress-nginx
|
||||
# The pool's size is written out rather than left to the pool chart's
|
||||
# schema defaults, which a platform-rendered release never carries, so
|
||||
# the release alone says what the pool can reserve.
|
||||
- equal:
|
||||
path: spec.values.minReplicas
|
||||
value: 0
|
||||
- equal:
|
||||
path: spec.values.maxReplicas
|
||||
value: 10
|
||||
- equal:
|
||||
path: spec.values.instanceType
|
||||
value: u1.medium
|
||||
- equal:
|
||||
path: spec.values.diskSize
|
||||
value: 20Gi
|
||||
path: spec.values
|
||||
value:
|
||||
cluster: computeplane-cluster
|
||||
clusterReleaseName: computeplane-cluster
|
||||
roles: [ingress-nginx]
|
||||
minReplicas: 0
|
||||
# canonical KubernetesNodes pool shape (mirrors rest.go): RetryOnFailure
|
||||
# strategy + disableWait, not the parent module's remediation style.
|
||||
- equal:
|
||||
|
||||
Reference in new issue
Block a user