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

fix: metric server serve on all ipv4 interfaces #10613

Merged

Conversation

prezha
Copy link
Contributor

@prezha prezha commented Feb 25, 2021

fixes #10581

before: as detailed in the original issue's description

after:

I0225 03:41:17.654624 1 node.go:172] Successfully retrieved node IP: 192.168.49.3
I0225 03:41:17.654669 1 server_others.go:142] kube-proxy node IP is an IPv4 address (192.168.49.3), assume IPv4 operation
W0225 03:41:17.673421 1 server_others.go:578] Unknown proxy mode "", assuming iptables proxy
I0225 03:41:17.673524 1 server_others.go:185] Using iptables Proxier.
I0225 03:41:17.673788 1 server.go:650] Version: v1.20.2
I0225 03:41:17.674041 1 conntrack.go:52] Setting nf_conntrack_max to 524288
E0225 03:41:17.674338 1 conntrack.go:127] sysfs is not writable: {Device:sysfs Path:/sys Type:sysfs Opts:[ro nosuid nodev noexec relatime] Freq:0 Pass:0} (mount options are [ro nosuid nodev noexec relatime])
I0225 03:41:17.674408 1 conntrack.go:100] Set sysctl 'net/netfilter/nf_conntrack_tcp_timeout_established' to 86400
I0225 03:41:17.674452 1 conntrack.go:100] Set sysctl 'net/netfilter/nf_conntrack_tcp_timeout_close_wait' to 3600
I0225 03:41:17.674569 1 config.go:315] Starting service config controller
I0225 03:41:17.674580 1 shared_informer.go:240] Waiting for caches to sync for service config
I0225 03:41:17.674658 1 config.go:224] Starting endpoint slice config controller
I0225 03:41:17.674670 1 shared_informer.go:240] Waiting for caches to sync for endpoint slice config
I0225 03:41:17.774816 1 shared_informer.go:247] Caches are synced for endpoint slice config
I0225 03:41:17.774817 1 shared_informer.go:247] Caches are synced for service config

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 25, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @prezha. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 25, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@prezha prezha changed the title make metric server server on all ipv4 interfaces make metric server serve on all ipv4 interfaces Feb 25, 2021
@applitect
Copy link

As commented in the bug report, I did test this reviewing the output for successful startup of the kube-proxy on minion nodes with the following manual test cases:
✅ Tested creating 4 nodes at startup
✅ Tested creating 1 node at startup
✅ Tested adding node after startup
✅ Tested deleting node then adding new node (this one acted strange but eventually came up

@medyagh
Copy link
Member

medyagh commented Feb 25, 2021

@prezha I see a {{.AdvertiseAddress}} that been changed to 0.0.0.0 I wonder how that affects other things ...I see it is being filled here


	opts := struct {
		CertDir             string
		ServiceCIDR         string
		PodSubnet           string
		AdvertiseAddress    string
		APIServerPort       int
		KubernetesVersion   string
		EtcdDataDir         string
		EtcdExtraArgs       map[string]string
		ClusterName         string
		NodeName            string
		DNSDomain           string
		CRISocket           string
		ImageRepository     string
		ComponentOptions    []componentOptions
		FeatureArgs         map[string]bool
		NoTaintMaster       bool
		NodeIP              string
		CgroupDriver        string
		ClientCAFile        string
		StaticPodPath       string
		ControlPlaneAddress string
		KubeProxyOptions    map[string]string
	}{
		CertDir:           vmpath.GuestKubernetesCertsDir,
		ServiceCIDR:       constants.DefaultServiceCIDR,
		PodSubnet:         podCIDR,
		AdvertiseAddress:  n.IP,

I am curious what @sadlil thinks about this PR

@prezha
Copy link
Contributor Author

prezha commented Feb 25, 2021

@prezha I see a {{.AdvertiseAddress}} that been changed to 0.0.0.0 I wonder how that affects other things ...I see it is being filled here


	opts := struct {
		CertDir             string
		ServiceCIDR         string
		PodSubnet           string
		AdvertiseAddress    string
		APIServerPort       int
		KubernetesVersion   string
		EtcdDataDir         string
		EtcdExtraArgs       map[string]string
		ClusterName         string
		NodeName            string
		DNSDomain           string
		CRISocket           string
		ImageRepository     string
		ComponentOptions    []componentOptions
		FeatureArgs         map[string]bool
		NoTaintMaster       bool
		NodeIP              string
		CgroupDriver        string
		ClientCAFile        string
		StaticPodPath       string
		ControlPlaneAddress string
		KubeProxyOptions    map[string]string
	}{
		CertDir:           vmpath.GuestKubernetesCertsDir,
		ServiceCIDR:       constants.DefaultServiceCIDR,
		PodSubnet:         podCIDR,
		AdvertiseAddress:  n.IP,

I am curious what @sadlil thinks about this PR

@medyagh , here we are not modifying the value of AdvertiseAddress, instead, we are using a specific value of 0.0.0.0 vs taking AdvertiseAddress as a param (as it was before)?

would love to hear also @sadlil 's thoughts too

@medyagh
Copy link
Member

medyagh commented Feb 25, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 25, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: prezha, sadlil
To complete the pull request process, please assign ilya-zuyev after the PR has been reviewed.
You can assign the PR to them by writing /assign @ilya-zuyev in a comment when ready.

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

@sadlil
Copy link
Contributor

sadlil commented Feb 26, 2021

I am okay with bind the metric servers in 0.0.0.0, But I am not really sure if this could potentially open any security holes. Going through the kube-proxy docs doesn't sounds like it. If that does, user have the options to configure for different interface or disable it by --extra-config=kube-proxy.metricsBindAddress=''.

@prezha
Copy link
Contributor Author

prezha commented Feb 26, 2021

thank you @sadlil for your review and comments!

@medyagh medyagh merged commit 5b7af83 into kubernetes:master Mar 1, 2021
@medyagh medyagh changed the title make metric server serve on all ipv4 interfaces fix: metric server serve on all ipv4 interfaces Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minion node minikube-m02 kube-proxy unable to start because metrics server failed
6 participants