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

kube-proxy: make --init-only a no-op on Windows #121529

Closed
wants to merge 1 commit into from

Conversation

uablrek
Copy link
Contributor

@uablrek uablrek commented Oct 26, 2023

This will allow the same installation manifest to be used on Windows and Linux

/kind bug
/area kube-proxy
/sig network
/sig windows
/area kubeadm

What this PR does / why we need it:

Kubeadm makes no difference between Windows/Linux when installing kube-proxy. The --init-only flag should therefore be a no-op on Windows, rather than an error.

Which issue(s) this PR fixes:

It doesn't fix, but it helps kubernetes/kubeadm#2948

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

This will allow the same installation manifest to be used
on Windows and Linux
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/kube-proxy sig/network Categorizes an issue or PR as relevant to SIG Network. sig/windows Categorizes an issue or PR as relevant to SIG Windows. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/kubeadm labels Oct 26, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 26, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: uablrek
Once this PR has been reviewed and has the lgtm label, please assign aojea for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@uablrek
Copy link
Contributor Author

uablrek commented Oct 26, 2023

/cc @neolit123 @danwinship @jsturtevant

I can't test this myself

@uablrek
Copy link
Contributor Author

uablrek commented Oct 26, 2023

Ref #120864 (comment)

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/lgtm

this makes sense to me, but it needs a sanity check.

Ref #120864 (comment)

yes, please see this comment about supporting an OS-portable manifest.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 26, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c302e7da4d845d0a9002e61981954c14596f7bda

@neolit123
Copy link
Member

Kubeadm makes no difference between Windows/Linux when installing kube-proxy. The --init-only flag should therefore be a no-op on Windows, rather than an error.

thanks for sending this PR!

@@ -81,7 +82,8 @@ func (s *ProxyServer) platformCheckSupported() (ipv4Supported, ipv6Supported, du
// createProxier creates the proxy.Provider
func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguration, dualStackMode, initOnly bool) (proxy.Provider, error) {
if initOnly {
return nil, fmt.Errorf("--init-only is not implemented on Windows")
klog.Info("--init-only is not implemented on Windows")
return nil, nil
Copy link
Member

@neolit123 neolit123 Oct 26, 2023

Choose a reason for hiding this comment

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

what happens in the code path if a nil proxier without an error is returned?
shouldn't this be handled with an additional check somewhere so that there are no panics?

EDIT: maybe a unit test is needed too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got a contradicting comment from @thockin #120864 (comment). @neolit123 please coordinate with him and I do whatever you think is best

Copy link
Member

@neolit123 neolit123 Oct 26, 2023

Choose a reason for hiding this comment

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

I don't mind the exact implementation details. IMO, what makes sense for Windows and the multi-os portability:

  • the flag is passed, kube-proxy shows a message and exits with status 0. status 1 is more accurate, but this is done to not trip the init container setup.
  • the flag is not passed, kube-proxy runs in priv mode as it does today.

EDIT: also note that:

kube-proxy: make --init-only a no-op on Windows

technically, it's not a NO-OP if status 0 is returned.

Copy link
Member

Choose a reason for hiding this comment

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

mentioned this ^ in #sig-windows on the k8s slack:
https://kubernetes.slack.com/archives/C0SJ4AFB7/p1698317022006619

@k8s-ci-robot
Copy link
Contributor

@uablrek: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-capz-windows-master caf0b63 link false /test pull-kubernetes-e2e-capz-windows-master

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@danwinship
Copy link
Contributor

This will allow the same installation manifest to be used on Windows and Linux

But it doesn't allow that, does it? You'd need:

Linux:

  • initContainer: privileged: true, kube-proxy --init-only
  • container: kube-proxy

Windows:

  • container: privileged: true, kube-proxy

So if we see --init-only on Windows, it means the user is trying to deploy kube-proxy in a way that doesn't work on Windows. Right?

@neolit123
Copy link
Member

@uablrek looks like this can be closed and 2 DS is the only option forward.

more comments in #120864

@uablrek uablrek closed this Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kube-proxy area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants