fix(platform): pin the apiserver etcd to the local storage class

The chart default is the replicated class, written into the
EtcdCluster's storageClassName — a field that is immutable post-create.
A fresh install without that class leaves the PVCs Pending and the sdn
apiserver down, recoverable only by deleting the EtcdCluster and with
it every sdn object. The platform now sets the class on the component:
local, because a 3-member etcd already replicates at the application
level and the local class exists before any replication pool is
configured.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
Timofei Larkin committed 2026-11-19 12:04:16 +01:00
1 parent 296ce0bf7f
commit 673cd43d28
2 files changed
+25 -1

No files matched your search

@@ -289,7 +289,13 @@
the tenant kinds have no CRDs at all. The CNI package ships only the LOCAL
group's CRDs (local.sdn.cozystack.io — underlay IPAM, which must work
before cert-manager, etcd and this server, all of which are pods). */ -}}
{{include "cozystack.platform.package.default" (list "cozystack.cozyplane-apiserver" $) }}
{{- /* local, not the chart's replicated default: a 3-member etcd already
replicates at the application level, and the local class exists before
any replication pool is configured. The EtcdCluster's storageClassName
is immutable post-create, so the default has to be right on the first
render. */ -}}
{{- $cozyplaneApiserverComponents := dict "cozyplane-apiserver" (dict "values" (dict "etcd" (dict "operator" (dict "storageClass" "local")))) -}}
{{include "cozystack.platform.package" (list "cozystack.cozyplane-apiserver" "default" $ $cozyplaneApiserverComponents) }}
{{- end }}
{{- /* The ClusterIssuers of cert-manager-issuers and the per-tenant Issuers
rendered for TenantGateway both use an http01.gatewayHTTPRoute solver
@@ -254,6 +254,24 @@ tests:
path: spec.components.cozyplane.values.egress.clusterDNS
value: "fd00:10:96::a"
# storageClassName is immutable on the EtcdCluster, so the platform must set
# the right class on the first render; local, because a 3-member etcd already
# replicates at the application level and local exists before any pool setup.
- it: pins the apiserver etcd to the local storage class
set:
bundles:
system:
enabled: true
variant: isp-full
networkingVariant: cozyplane
asserts:
- documentSelector:
path: metadata.name
value: cozystack.cozyplane-apiserver
equal:
path: spec.components.cozyplane-apiserver.values.etcd.operator.storageClass
value: local
# The ciliumPool derivation requires a /20-or-shorter podCIDR — a kube-ovn
# constraint: the last /21 is carved out for Cilium. cozyplane runs no
# kube-ovn, so a small pod CIDR must render there.