Skip to content

feat: refactor KubePrism config into multidoc#13820

Open
smira wants to merge 1 commit into
siderolabs:mainfrom
smira:feat/kubeprism-config
Open

feat: refactor KubePrism config into multidoc#13820
smira wants to merge 1 commit into
siderolabs:mainfrom
smira:feat/kubeprism-config

Conversation

@smira

@smira smira commented Jul 21, 2026

Copy link
Copy Markdown
Member

Mostly one-to-one translation, but it also incorporates work from the PR #13425 to add support for TLSServerName.

Fixes #13424

Fixes #13777

Copilot AI review requested due to automatic review settings July 21, 2026 17:25
@smira smira added integration/cilium Run Cilium integration tests integration/misc Run all misc integration tests (misc-0 through misc-4) labels Jul 21, 2026
@github-project-automation github-project-automation Bot moved this to To Do in Planning Jul 21, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors KubePrism configuration from the legacy .machine.features.kubePrism field into a dedicated multi-document KubePrismConfig (v1alpha1) and wires the new config through controllers and config generation. It also incorporates tlsServerName support so the kubelet kubeconfig can set clusters[0].cluster.tls-server-name when KubePrism is used.

Changes:

  • Introduce KubePrismConfig as a Kubernetes multi-doc config and plumb it through config/container accessors and machined controllers.
  • Add tlsServerName support via K8sKubePrismConfig -> secrets.KubeletSpec.EndpointTLSServerName -> kubelet kubeconfig writing.
  • Update schemas/docs/testdata to reflect the new multi-doc config and deprecate .machine.features.kubePrism.

Reviewed changes

Copilot reviewed 34 out of 38 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
website/content/v1.14/schemas/config.schema.json Adds KubePrismConfig schema + removes legacy .machine.features.kubePrism schema entry.
website/content/v1.14/reference/configuration/v1alpha1/config.md Removes KubePrism from v1alpha1 reference docs (deprecated path).
website/content/v1.14/reference/configuration/kubernetes/kubeproxyconfig.md Fixes KubeProxyConfig description text.
website/content/v1.14/reference/configuration/kubernetes/kubeprismconfig.md New reference page for KubePrismConfig (multi-doc).
website/content/v1.14/reference/api.md Documents new endpoint_tls_server_name field on KubeletSpec.
pkg/machinery/resources/secrets/kubelet.go Adds EndpointTLSServerName to the secrets Kubelet resource spec.
pkg/machinery/config/types/v1alpha1/v1alpha1_types.go Marks legacy kubePrism config as deprecated/nodoc.
pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go Removes legacy KubePrism docs output from v1alpha1 docgen.
pkg/machinery/config/types/v1alpha1/v1alpha1_k8s_bridge.go Adds K8sKubePrismConfig() bridge for v1alpha1 configs.
pkg/machinery/config/types/v1alpha1/v1alpha1_features.go Removes legacy Features.KubePrism() provider; adapts legacy KubePrism to K8sKubePrismConfig.
pkg/machinery/config/types/v1alpha1/testdata/stability/v1.14/overrides-worker.yaml Migrates stability testdata to new KubePrismConfig doc.
pkg/machinery/config/types/v1alpha1/testdata/stability/v1.14/overrides-controlplane.yaml Migrates stability testdata to new KubePrismConfig doc.
pkg/machinery/config/types/v1alpha1/testdata/stability/v1.14/base-worker.yaml Migrates stability testdata to new KubePrismConfig doc.
pkg/machinery/config/types/v1alpha1/testdata/stability/v1.14/base-controlplane.yaml Migrates stability testdata to new KubePrismConfig doc.
pkg/machinery/config/types/k8s/proxy.go Updates KubeProxyConfig doc comment.
pkg/machinery/config/types/k8s/kubeprism.go Adds new KubePrismConfig multi-doc type, validation, and conflict validation.
pkg/machinery/config/types/k8s/k8s.go Includes kubeprism.go in docgen/deep-copy generation.
pkg/machinery/config/types/k8s/k8s_doc.go Adds doc output for KubePrismConfig and updates KubeProxyConfig description.
pkg/machinery/config/types/k8s/deep_copy.generated.go Adds DeepCopy for KubePrismConfigV1Alpha1.
pkg/machinery/config/schemas/config.schema.json Adds KubePrismConfig schema + removes legacy .machine.features.kubePrism schema entry.
pkg/machinery/config/generate/worker.go Stops emitting legacy .machine.features.kubePrism when multidoc Kubernetes config is supported.
pkg/machinery/config/generate/kubernetes.go Emits KubePrismConfig doc by default (config-gen) with port override support.
pkg/machinery/config/generate/init.go Stops emitting legacy .machine.features.kubePrism when multidoc Kubernetes config is supported.
pkg/machinery/config/container/container.go Adds K8sKubePrismConfig() accessor with legacy fallback.
pkg/machinery/config/config/machine.go Removes legacy Features.KubePrism() interface.
pkg/machinery/config/config/k8s.go Introduces K8sKubePrismConfig interface (port + tlsServerName).
pkg/machinery/config/config/config.go Adds K8sKubePrismConfig() to the config.Config interface.
pkg/machinery/api/resource/definitions/secrets/secrets.pb.go Regenerates protobuf for endpoint_tls_server_name.
pkg/machinery/api/resource/definitions/secrets/secrets_vtproto.pb.go Regenerates vtproto for endpoint_tls_server_name.
internal/app/machined/pkg/controllers/secrets/root.go Switches KubePrism detection from legacy features to K8sKubePrismConfig().
internal/app/machined/pkg/controllers/secrets/kubelet.go Propagates KubePrism TLS server name into secrets (EndpointTLSServerName).
internal/app/machined/pkg/controllers/secrets/kubelet_test.go Adds test coverage for TLSServerName propagation via KubePrismConfig doc.
internal/app/machined/pkg/controllers/k8s/kubeprism_config.go Switches controller gating/port selection to K8sKubePrismConfig().
internal/app/machined/pkg/controllers/k8s/kubeprism_config_test.go Updates test to mutate legacy config via raw v1alpha1 access.
internal/app/machined/pkg/controllers/k8s/kubelet_service.go Writes/refreshes kubelet kubeconfig with tls-server-name when configured.
internal/app/machined/pkg/controllers/k8s/control_plane.go Switches KubePrism endpoint selection to K8sKubePrismConfig().
hack/release.toml Documents deprecation of .machine.features.kubePrism.
api/resource/definitions/secrets/secrets.proto Adds endpoint_tls_server_name to KubeletSpec proto definition.
Files not reviewed (4)
  • pkg/machinery/api/resource/definitions/secrets/secrets.pb.go: Generated file
  • pkg/machinery/api/resource/definitions/secrets/secrets_vtproto.pb.go: Generated file
  • pkg/machinery/config/types/k8s/deep_copy.generated.go: Generated file
  • pkg/machinery/config/types/k8s/k8s_doc.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/machinery/config/types/k8s/kubeprism.go Outdated
Comment thread pkg/machinery/config/types/k8s/k8s_doc.go Outdated
Comment thread pkg/machinery/config/schemas/config.schema.json Outdated
Comment thread website/content/v1.14/schemas/config.schema.json Outdated
Comment thread website/content/v1.14/reference/configuration/kubernetes/kubeprismconfig.md Outdated
Mostly one-to-one translation, but it also incorporates work from
the PR siderolabs#13425 to add support for TLSServerName.

Fixes siderolabs#13424

Fixes siderolabs#13777

Co-authored-by: IvanHunters <xorokhotnikov@gmail.com>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira

smira commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

The test failure is unrelated: #13821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration/cilium Run Cilium integration tests integration/misc Run all misc integration tests (misc-0 through misc-4) status/ok-to-test

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

refactor KubePrismConfig Allow overriding kubelet kubeconfig tls-server-name when KubePrism is enabled (SNI-based ingress passthrough)

3 participants