feat: refactor KubePrism config into multidoc#13820
Open
smira wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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
KubePrismConfigas a Kubernetes multi-doc config and plumb it through config/container accessors and machined controllers. - Add
tlsServerNamesupport viaK8sKubePrismConfig->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.
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
force-pushed
the
feat/kubeprism-config
branch
from
July 21, 2026 17:41
29a568b to
aa666b0
Compare
7 tasks
Member
Author
|
The test failure is unrelated: #13821 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mostly one-to-one translation, but it also incorporates work from the PR #13425 to add support for TLSServerName.
Fixes #13424
Fixes #13777