Skip to content

Conversation

@kke
Copy link
Contributor

@kke kke commented Nov 20, 2025

Description

Uses pipe based transport on Windows to serve and query the status component.

Fixes #2887

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@kke kke force-pushed the k0s-status-on-win branch 2 times, most recently from 063218c to a0d8253 Compare November 20, 2025 12:13
@kke
Copy link
Contributor Author

kke commented Nov 27, 2025

C:\Users\Administrator> k0s status
Version: v1.34.1+k0s.0-272-gb9f57feaf
Process ID: 4028
Role: worker
Workloads: true
SingleNode: false
Kube-api probing successful: true
Kube-api probing last error:

@kke kke force-pushed the k0s-status-on-win branch 3 times, most recently from 9bee0b9 to 0e285d5 Compare November 27, 2025 13:54
@kke
Copy link
Contributor Author

kke commented Nov 27, 2025

Autopilot always uses the default socket path 🤔 ref: #6750

@kke kke force-pushed the k0s-status-on-win branch 2 times, most recently from d3b08fd to 1353d86 Compare November 28, 2025 14:42
@kke kke changed the title Implement "k0s status" on Windows Enable "k0s status" sub-command on Windows workers Nov 28, 2025
@kke kke force-pushed the k0s-status-on-win branch from 1353d86 to 9242028 Compare November 28, 2025 15:06
@kke kke changed the title Enable "k0s status" sub-command on Windows workers Enable "k0s status" on Windows workers Nov 28, 2025
@kke kke force-pushed the k0s-status-on-win branch from 9242028 to 3f74aaa Compare December 1, 2025 08:37
kke added 2 commits December 1, 2025 11:34
Named pipes are now used for the status component on Windows.

Autopilot has been changed to use the constant from the status package
instead of defining a new constant. Note that autopilot currently breaks
if you don't use the default status socket path, this needs to be fixed
elsewhere.

Signed-off-by: Kimmo Lehto <[email protected]>
The "k0s status" sub-command was not built into Windows binaries as the
status compoennt did not yet run on windows.

Signed-off-by: Kimmo Lehto <[email protected]>
@kke kke force-pushed the k0s-status-on-win branch from 3f74aaa to 95fa26f Compare December 1, 2025 09:36
@kke kke marked this pull request as ready for review December 1, 2025 11:01
@kke kke requested review from a team as code owners December 1, 2025 11:01
@kke kke requested review from juanluisvaladas and twz123 December 1, 2025 11:01
Copy link
Member

@twz123 twz123 left a comment

Choose a reason for hiding this comment

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

Hot fuzz! 🌶️

Comment on lines +145 to +149
if cobraCmd != nil {
if val, err := cobraCmd.Flags().GetString("status-socket"); err == nil {
statusSocketPath = val
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is not required, as it's done in WithCommand, which is being called later in this method?

Suggested change
if cobraCmd != nil {
if val, err := cobraCmd.Flags().GetString("status-socket"); err == nil {
statusSocketPath = val
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, looks like that, I followed what is done above with data-dir and kubelet-root-dir. I think the withCommand overwrites those too.

Copy link
Contributor Author

@kke kke Dec 3, 2025

Choose a reason for hiding this comment

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

Looks like it may be a larger can of worms and it could be better to fix separately as it applies to other flags too.

kke and others added 6 commits December 3, 2025 10:44
The client can be built universally, only the dialcontext needs to be
different for linux/win.

Co-authored-by: Tom Wieczorek <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Move listener creation from Init function to Start as Init is not
supposed to create resources that need clean-up.

Let httpserver.Shutdown handle closing of the listener.

Signed-off-by: Kimmo Lehto <[email protected]>
The run-dir is forced to /run/k0s for root above so there's no need to
re-check euid when building the socket path.

Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Copy link
Member

@twz123 twz123 left a comment

Choose a reason for hiding this comment

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

Nice!

@twz123 twz123 added the enhancement New feature or request label Dec 3, 2025
@kke kke merged commit c9ed299 into main Dec 3, 2025
201 of 202 checks passed
@kke kke deleted the k0s-status-on-win branch December 3, 2025 11:29
@twz123 twz123 added the backport/release-1.34 PR that needs to be backported/cherrypicked to the release-1.34 branch label Dec 3, 2025
@k0s-bot
Copy link
Contributor

k0s-bot commented Dec 3, 2025

Successfully created backport PR for release-1.34:

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

Labels

area/cli area/windows backport/release-1.34 PR that needs to be backported/cherrypicked to the release-1.34 branch enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

k0s status on windows

4 participants