Skip to content

fix: provide non-sensitive KubeletStatus resource#13823

Open
smira wants to merge 1 commit into
siderolabs:mainfrom
smira:fix/kubelet-status
Open

fix: provide non-sensitive KubeletStatus resource#13823
smira wants to merge 1 commit into
siderolabs:mainfrom
smira:fix/kubelet-status

Conversation

@smira

@smira smira commented Jul 21, 2026

Copy link
Copy Markdown
Member

Fixes #13819

Provide a non-sensitive counterpart to KubeletSpec, consume it in the dashboard (for compatibility, in parallel with KubeletSpec).

Fix the image tag parsing to correctly ignore digested references while I'm at it.

Fixes siderolabs#13819

Provide a non-sensitive counterpart to KubeletSpec, consume it in the
dashboard (for compatibility, in parallel with KubeletSpec).

Fix the image tag parsing to correctly ignore digested references while
I'm at it.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Copilot AI review requested due to automatic review settings July 21, 2026 19:52
@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
Comment thread pkg/kubernetes/version.go
// VersionFromImageRef extracts the tag out of the image reference, ignoring the digest (if present).
//
// It returns false if the reference can't be parsed or if the tag is missing.
func VersionFromImageRef(image string) (string, bool) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

todo (for myself): there might be more places where this can be used

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 restores Kubernetes version visibility in the on-node console dashboard when running under os:reader by introducing a non-sensitive KubeletStatus resource (mirroring the kubelet image reference), while keeping backward compatibility by still watching KubeletSpec in parallel. It also centralizes and fixes kubelet image tag parsing to correctly handle tag+digest image references.

Changes:

  • Add k8s.KubeletStatus (non-sensitive) resource plus a controller that derives it from k8s.KubeletSpec.
  • Update the dashboard resource watches and Kubernetes version rendering to use KubeletStatus when available (and KubeletSpec otherwise).
  • Add kubernetes.VersionFromImageRef helper + tests to correctly extract the tag while ignoring digests.

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/content/v1.14/reference/api.md Documents the newly added KubeletStatusSpec in the API reference.
pkg/machinery/resources/k8s/kubelet_status.go Introduces the KubeletStatus resource type (non-sensitive, exposes kubelet image ref).
pkg/machinery/resources/k8s/k8s.go Adds KubeletStatusSpec to deep-copy generation list.
pkg/machinery/resources/k8s/k8s_test.go Ensures KubeletStatus is included in resource registration tests.
pkg/machinery/resources/k8s/deep_copy.generated.go Generated deep-copy method for KubeletStatusSpec.
api/resource/definitions/k8s/k8s.proto Adds protobuf message definition for KubeletStatusSpec.
pkg/machinery/api/resource/definitions/k8s/k8s.pb.go Generated protobuf Go bindings updated for KubeletStatusSpec.
pkg/machinery/api/resource/definitions/k8s/k8s_vtproto.pb.go Generated vtproto marshal/size/unmarshal for KubeletStatusSpec.
internal/app/machined/pkg/controllers/k8s/kubelet_status.go New controller publishing KubeletStatus from KubeletSpec.
internal/app/machined/pkg/controllers/k8s/kubelet_status_test.go Controller test verifying reconcile/update/delete behavior.
internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_state.go Registers KubeletStatus resource in v1alpha2 runtime state.
internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_controller.go Registers KubeletStatusController in the v1alpha2 controller set.
internal/pkg/dashboard/resourcedata/resourcedata.go Watches both KubeletSpec and KubeletStatus for compatibility across versions/RBAC.
internal/pkg/dashboard/components/kubernetesinfo.go Consumes both resources and uses robust tag extraction for displayed Kubernetes version.
pkg/kubernetes/version.go Adds VersionFromImageRef helper (tag extraction ignoring digest).
pkg/kubernetes/version_test.go Adds unit tests covering tagged, tagged+digested, digested-only, and invalid refs.
Files not reviewed (3)
  • pkg/machinery/api/resource/definitions/k8s/k8s.pb.go: Generated file
  • pkg/machinery/api/resource/definitions/k8s/k8s_vtproto.pb.go: Generated file
  • pkg/machinery/resources/k8s/deep_copy.generated.go: Generated file

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

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

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Console dashboard shows n/a for Kubernetes version since v1.13.4 (os:reader denied on sensitive KubeletSpec)

3 participants