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
merge duplicated linux/windows kube-proxy setup code #118017
merge duplicated linux/windows kube-proxy setup code #118017
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
d8f80e8
to
d8db722
Compare
Hm... initial push failed CI because replacing |
@BenTheElder may have more historical context, or @dims |
For a few tools like verify-typecheck.sh it's easier to at least build these things even if we don't ship them |
IIRC verify-typecheck.sh is setting both GOOS and GOARCH to target the platforms we build for, it shouldn't need to build this for mac. I have no idea why we'd build kube-proxy for mac, we aren't in releases? It is nice to have code compile in IDEs and run tests, but if it's calling out to OS specific stuff then that doesn't help a lot. I would guess we just refactored to add windows support and added |
@BenTheElder don't we have kube-proxy for Mac in downloads (https://kubernetes.io/releases/download/#container-images)? if it was the thing you were mentioning above. |
Er no? What would a Mac container image look like? The kube-proxy image in the release notes is only for Linux, not even Windows. We have Linux and Windows binaries for some node components. $ gsutil ls gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl-convert
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl-convert.cert
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl-convert.sha256
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl-convert.sha512
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl-convert.sig
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl.cert
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl.sha256
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl.sha512
gs://kubernetes-release/release/v1.27.0/bin/darwin/amd64/kubectl.si |
I don't understand what's wrong in;
|
hmmm..looks like above is correct assumption. we can see windows binaries of kube-proxy available @https://www.downloadkubernetes.com though, not sure why those are missing in release notes. |
Sorry, I didn't provide a ton of context on the build stuff because I didn't mean for this bug to turn into a discussion of that (see #118020 instead). But to clarify since different people seem to be missing different parts of the context;
|
I don't know who is depending on this, but for reference @ 3588d09 (current $ git rev-parse HEAD
3588d091ff3549b50e9c993b12b169b4caeb105f
$ uname
Darwin
$ go build -o ./kubelet ./cmd/kubelet
$ ./kubelet
E0516 11:13:54.187405 69372 run.go:74] "command failed" err="failed to construct kubelet dependencies: mkdir /var/lib/kubelet: permission denied"
$ go build -o ./kube-proxy ./cmd/kube-proxy
$ ./kube-proxy
I0516 11:17:04.538852 69859 server.go:233] "Warning, all flags other than --config, --write-config-to, and --cleanup are deprecated, please begin using a config file ASAP"
I0516 11:17:04.539004 69859 server_others.go:75] "Using iptables proxy"
I0516 11:17:04.539251 69859 server.go:531] "Neither kubeconfig file nor master URL was specified, falling back to in-cluster config"
E0516 11:17:04.539272 69859 server.go:484] "Error running ProxyServer" err="unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined"
E0516 11:17:04.539290 69859 run.go:74] "command failed" err="unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined" |
d8db722
to
4e1f928
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
(done) |
Move the Linux-specific conntrack setup code into a new "platformSetup" rather than trying to fit it into the generic setup code. Also move metrics registration there.
4e1f928
to
6232ac7
Compare
weird failures /test pull-kubernetes-e2e-kind-ipv6 |
@@ -329,7 +328,6 @@ func newProxyServer( | |||
if err != nil { | |||
return nil, fmt.Errorf("unable to create proxier: %v", err) | |||
} | |||
proxymetrics.RegisterMetrics() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was kind of weird, no? initializing in two different places instead doing just in one, maybe a copy paste thing
@@ -319,7 +322,7 @@ func (o *Options) Run() error { | |||
return cleanupAndExit() | |||
} | |||
|
|||
proxyServer, err := NewProxyServer(o) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope nobody is importing this
/lgtm |
LGTM label has been added. Git tree hash: 151d8ac0e7f0e6bcba0e8a8165d657ad8dc2e284
|
NodeRef *v1.ObjectReference | ||
HealthzServer healthcheck.ProxierHealthUpdater | ||
Hostname string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be internal variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean hostname
rather than Hostname
? yeah, the whole struct is wrong that way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
There is currently a lot of duplicated code between the linux (iptables/ipvs) and windows (winkernel) kube-proxy setup. This extracts it out to the shared code, along with a bit of other platform-related refactoring.
extracted from #117436
Does this PR introduce a user-facing change?
/sig network