From b983a5c34ef5a49fabf686daff0cf55ea150039b Mon Sep 17 00:00:00 2001 From: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> Date: Mon, 19 Oct 2026 18:15:15 +0300 Subject: [PATCH] fix(kubernetes): apply the worker TalosConfigTemplate server-side in the kubernetes chart On release-1.6 the kubernetes chart still renders a talos-reconcile Job for every node group, and that Job applies the worker TalosConfigTemplate client-side under a 256Mi memory limit. Once the template exists, a client-side apply builds its merge patch from the full OpenAPI document of the management cluster, which #4163 measured above that limit on a cluster with a few hundred CRDs. Every chart upgrade runs the Job again against the existing template, so kubectl is OOMKilled and the Job crash-loops after each upgrade. On a v1.6.5 cluster upgraded from v1.6.4 its log ends with the KamajiControlPlane patch and the container was OOMKilled. The server-side apply from #4163 reached release-1.6 through #4575, which changed the kubernetes-nodes chart only. On main the kubernetes chart no longer renders worker pools (92b9785da), so this Job and this fix exist on release-1.6 only. This uses the same server-side apply with --force-conflicts as kubernetes-nodes. The merge happens in the apiserver, so kubectl never loads the schema, and --force-conflicts keeps the Job authoritative over a template an earlier client-side apply created. The Role already grants create and patch on talosconfigtemplates. The Job spec changes, so its content-hash name moves and existing clusters get a new Job on their next upgrade. Assisted-by: LLM Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> --- .../templates/talos/talos-reconcile-job.yaml | 2 +- ...alos_reconcile_server_side_apply_test.yaml | 75 +++++++++++++++++++ .../tests/talos_templates_test.yaml | 8 +- 3 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 packages/apps/kubernetes/tests/talos_reconcile_server_side_apply_test.yaml diff --git a/packages/apps/kubernetes/templates/talos/talos-reconcile-job.yaml b/packages/apps/kubernetes/templates/talos/talos-reconcile-job.yaml index 0ede75d5b..c2c429eec 100644 --- a/packages/apps/kubernetes/templates/talos/talos-reconcile-job.yaml +++ b/packages/apps/kubernetes/templates/talos/talos-reconcile-job.yaml @@ -321,7 +321,7 @@ spec: # Apply the TalosConfigTemplate. ownerReference back to the KCP # makes the standard Kubernetes garbage collector clean it up on # release uninstall; Helm itself does not track this resource. - cat <