From 083ce146094172b11cbc2ee09f2cdece83faa907 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Thu, 29 Jan 2026 21:18:04 +0300 Subject: [PATCH] feat(platform): add configurable Kubernetes API server settings for non-Talos deployments Add networking.apiServer.host and networking.apiServer.port to platform values to allow overriding the default Talos KubePrism settings (localhost:7445). Also add networking.cilium.cgroup.autoMount for non-Talos clusters that need Cilium to mount cgroups automatically. Changes: - packages/core/platform/values.yaml: Add apiServer and cilium.cgroup settings - packages/core/platform/templates/bundles/system.yaml: Pass cilium values - packages/core/installer/values.yaml: Add kubernetesServiceHost/Port - packages/core/installer/templates/cozystack-operator.yaml: Template env vars Closes: #1933 Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- .../core/installer/templates/cozystack-operator.yaml | 4 ++-- packages/core/platform/templates/bundles/system.yaml | 5 +++++ packages/core/platform/values.yaml | 10 ++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/core/installer/templates/cozystack-operator.yaml b/packages/core/installer/templates/cozystack-operator.yaml index a88b2590..31028757 100644 --- a/packages/core/installer/templates/cozystack-operator.yaml +++ b/packages/core/installer/templates/cozystack-operator.yaml @@ -65,9 +65,9 @@ spec: {{- end }} env: - name: KUBERNETES_SERVICE_HOST - value: localhost + value: {{ .Values.cozystackOperator.kubernetesServiceHost | quote }} - name: KUBERNETES_SERVICE_PORT - value: "7445" + value: {{ .Values.cozystackOperator.kubernetesServicePort | quote }} hostNetwork: true tolerations: - key: "node.kubernetes.io/not-ready" diff --git a/packages/core/platform/templates/bundles/system.yaml b/packages/core/platform/templates/bundles/system.yaml index 96a88333..f683bf03 100644 --- a/packages/core/platform/templates/bundles/system.yaml +++ b/packages/core/platform/templates/bundles/system.yaml @@ -11,6 +11,11 @@ "SVC_CIDR" .Values.networking.serviceCIDR "JOIN_CIDR" .Values.networking.joinCIDR)) -}} {{- $_ := set $networkingComponents "kubeovn" (dict "values" $kubeovnValues) -}} +{{- $ciliumValues := dict "cilium" (dict + "k8sServiceHost" .Values.networking.apiServer.host + "k8sServicePort" .Values.networking.apiServer.port + "cgroup" (dict "autoMount" (dict "enabled" .Values.networking.cilium.cgroup.autoMount))) -}} +{{- $_ := set $networkingComponents "cilium" (dict "values" $ciliumValues) -}} {{- end -}} {{include "cozystack.platform.package" (list "cozystack.networking" "kubeovn-cilium" $ $networkingComponents) }} {{include "cozystack.platform.package.default" (list "cozystack.kubeovn-webhook" $) }} diff --git a/packages/core/platform/values.yaml b/packages/core/platform/values.yaml index f8a0a9e4..4665e86b 100644 --- a/packages/core/platform/values.yaml +++ b/packages/core/platform/values.yaml @@ -27,6 +27,16 @@ networking: podGateway: "10.244.0.1" serviceCIDR: "10.96.0.0/16" joinCIDR: "100.64.0.0/16" + # Kubernetes API server configuration for Cilium + # Defaults are for Talos KubePrism; override for non-Talos clusters + apiServer: + host: "localhost" + port: "7445" + # Cilium cgroup configuration + # Set autoMount to true for non-Talos clusters + cilium: + cgroup: + autoMount: false # Service publishing and ingress configuration publishing: host: "example.org"