From 673cd43d28b03af90106c4432b76010a58336c7b Mon Sep 17 00:00:00 2001 From: Timofei Larkin Date: Fri, 2 Oct 2026 19:50:58 +0300 Subject: [PATCH] fix(platform): pin the apiserver etcd to the local storage class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../platform/templates/bundles/system.yaml | 8 +++++++- .../tests/bundles_networking_variant_test.yaml | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/core/platform/templates/bundles/system.yaml b/packages/core/platform/templates/bundles/system.yaml index be7b3c8f8..2686cac79 100644 --- a/packages/core/platform/templates/bundles/system.yaml +++ b/packages/core/platform/templates/bundles/system.yaml @@ -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 diff --git a/packages/core/platform/tests/bundles_networking_variant_test.yaml b/packages/core/platform/tests/bundles_networking_variant_test.yaml index ff44a568d..16f5ef273 100644 --- a/packages/core/platform/tests/bundles_networking_variant_test.yaml +++ b/packages/core/platform/tests/bundles_networking_variant_test.yaml @@ -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.