Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: mutate additional kubeletconfiguration fields on join #2967

Closed
neolit123 opened this issue Nov 23, 2023 · 5 comments
Closed

windows: mutate additional kubeletconfiguration fields on join #2967

neolit123 opened this issue Nov 23, 2023 · 5 comments
Assignees
Labels
area/kubelet area/windows kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows.
Milestone

Comments

@neolit123
Copy link
Member

neolit123 commented Nov 23, 2023

PRs for the points listed below:


during join of a Windows worker node we download the kubelet-config from the cluster as usual, then we apply some mutations, notably around problematic paths with drive on Windows:
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/componentconfigs/kubelet_windows.go

but we are missing some more fields that do not work on Windows.

the kubelet defaults for EnforceNodeAllocatable=pods or CgroupsPerQOS=true are simply rejected on Windows with errors:

E1123 02:11:01.358586    5616 server.go:224] "Failed to validate kubelet configuration" err="[invalid configuration: CgroupsPerQOS (--cgroups-per-qos) true is not supported on Windows, invalid configuration: EnforceNodeAllocatable (--enforce-node-allocatable) [pods] is not supported on Windows]" path="&TypeMeta{Kind:,APIVersion:,}"

why are these the defaults, who knows...but that's not OS portable.

what can be done is override the defaults similarly to this:
https://github.com/kubernetes-sigs/sig-windows-tools/blob/28a4c4f4e9e0b65d4d1ed1841e11eca5a62bfafe/hostprocess/PrepareNode.ps1#L73

but using the kubeletconfiguration struct.
https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/

enforceNodeAllocatable: ""
cgroupsPerQOS: false

alternatively

we can try convincing the kubelet maintainers to change these defaults on Windows. that is the better solution, but similar requests have failed in the past.

https://github.com/kubernetes/kubernetes/blob/d61cbac69aae97db1839bd2e0e86d68f26b353a7/pkg/kubelet/apis/config/validation/validation_windows.go#L29
https://github.com/kubernetes/kubernetes/blob/d61cbac69aae97db1839bd2e0e86d68f26b353a7/cmd/kubelet/app/options/osflags_windows.go
https://github.com/kubernetes/kubernetes/blob/d61cbac69aae97db1839bd2e0e86d68f26b353a7/pkg/kubelet/apis/config/v1beta1/defaults.go#L148
https://github.com/kubernetes/kubernetes/blob/d61cbac69aae97db1839bd2e0e86d68f26b353a7/pkg/kubelet/apis/config/v1beta1/defaults.go#L245-L246

note, we do not own any tests other than unit tests for this, so best we can do is to just add the change and see if we can remove the flag overrides from https://github.com/kubernetes-sigs/sig-windows-tools/blob/28a4c4f4e9e0b65d4d1ed1841e11eca5a62bfafe/hostprocess/PrepareNode.ps1#L73, which is owned by sig-windows.

@neolit123 neolit123 added kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/windows Categorizes an issue or PR as relevant to SIG Windows. sig/node Categorizes an issue or PR as relevant to SIG Node. area/kubelet labels Nov 23, 2023
@neolit123 neolit123 self-assigned this Nov 23, 2023
@neolit123 neolit123 added this to the v1.30 milestone Nov 24, 2023
@ndixita
Copy link

ndixita commented Nov 29, 2023

@neolit123 could you please add more details like K8s version on which we can reproduce this issue?

@neolit123
Copy link
Member Author

@neolit123 could you please add more details like K8s version on which we can reproduce this issue?

@ndixita this is latest master of k/k.
ideally SIG node must take action on the above or kubeadm (SIG CL ) or Windows scripts (SIG Windows) must workaround the problem.

@pacoxu
Copy link
Member

pacoxu commented Feb 19, 2024

Why not just skip or ignore the args on Windows kubelet?

Edited: Just read kubernetes/kubernetes#123137. I prefer this change.

@neolit123 neolit123 modified the milestones: v1.30, v1.31 Apr 5, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 4, 2024
@neolit123 neolit123 removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 4, 2024
@kannon92 kannon92 moved this to Needs Information in SIG Node Bugs Jul 22, 2024
@neolit123
Copy link
Member Author

kubernetes/kubernetes#123137
merged, there isn't any AI here.

if more fields in kubeletconfig in the future break windows kubelet that's should be fixed in kubelet code like
kubernetes/kubernetes#123137 did.

in terms of what we do here:
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/componentconfigs/kubelet_windows.go

i don't think that can be fixed because client-go/kubelet uses the Abs() golang stdlib function which is not Windows compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet area/windows kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows.
Projects
Archived in project
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants