Commit Graph

50 Commits

Author SHA1 Message Date
Dan Winship
f994ae2521 Move GetHostname() from k/k/pkg/util/node to k/component-helpers/node/util
In fact, this actually uses pkg/util/node's GetHostname() but takes
the unit tests from cmd/kubeadm/app/util's private fork of that
function since they were more extensive. (Of course the fact that
kubeadm had a private fork of this function is a strong argument for
moving it to component-helpers.)
2023-01-27 18:24:38 -05:00
JunYang
cc4126a010 use klog.InfoS instead of klog.V(0).Info-proxy part 2022-12-29 11:16:51 +08:00
Amim Knabben
7df6c02288 Remove Linux and Windows Kube-proxy Userspace mode 2022-10-05 16:59:02 -03:00
JunYang
2db4dea565 use klog.InfoS instead of klog.V(0).InfoS 2022-08-25 18:46:34 +08:00
Dan Winship
946ce55b04 kube-proxy: use API constants for proxy modes rather than local redefinitions 2022-08-16 09:30:42 -04:00
Dan Winship
477d14e53b Reorganize "kube-proxy --cleanup-and-exit"
This was implemented partly in server.go and partly in
server_others.go even though even the parts in server.go were totally
linux-specific. Simplify things by putting it all in server_others.go
and get rid of some unnecessary abstraction.
2022-08-16 09:16:05 -04:00
Yongkun Gui
78a507b256 Fix health check from Google's Load Balancer
This change adds 2 options for windows:
--forward-healthcheck-vip: If true forward service VIP for health check
port
--root-hnsendpoint-name: The name of the hns endpoint name for root
namespace attached to l2bridge, default is cbr0

When --forward-healthcheck-vip is set as true and winkernel is used,
kube-proxy will add an hns load balancer to forward health check request
that was sent to lb_vip:healthcheck_port to the node_ip:healthcheck_port.
Without this forwarding, the health check from google load balancer will
fail, and it will stop forwarding traffic to the windows node.

This change fixes the following 2 cases for service:
- `externalTrafficPolicy: Cluster` (default option): healthcheck_port is
10256 for all services. Without this fix, all traffic won't be directly
forwarded to windows node. It will always go through a linux node and
get forwarded to windows from there.
- `externalTrafficPolicy: Local`: different healthcheck_port for each
service that is configured as local. Without this fix, this feature
won't work on windows node at all. This feature preserves client ip
that tries to connect to their application running in windows pod.

Change-Id: If4513e72900101ef70d86b91155e56a1f8c79719
2022-03-11 22:34:59 -08:00
Amim Knabben
8b37bfec8e Enabling kube-proxy metrics on windows kernel mode 2021-11-21 21:23:55 -03:00
Peri Thompson
b476eaade4 Adding deprecation notice to the userspace proxy-mode 2021-08-31 10:19:00 +01:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
James Sturtevant
d5d9327351 Only use dualstack if the node and config supports it 2021-07-08 11:39:20 -07:00
Swetha Repakula
0a42f7b989 Graduate EndpointSliceProxying and WindowsEndpointSliceProxying Gates 2021-07-07 13:33:30 -07:00
Yuan-Junliang
2e06066bab Migrate kube-proxy to use v1 Event API 2021-06-13 18:57:52 +08:00
Kubernetes Prow Robot
3d5ebcc37f
Merge pull request #101410 from songxiao-wang87/run-test5
Structured Logging migration: modify server_windows part logs of kube-proxy.
2021-04-27 14:53:39 -07:00
jornshen
c842cc5247 no watch endpointslice in userpace mode 2021-04-26 20:31:59 +08:00
songxiao-wang87
8eea052206 Making a run test.
Signed-off-by: songxiao-wang87 <wang.xiaosong23@zte.com.cn>
2021-04-23 16:01:29 +08:00
xh4n3
d6bc98fc5a fix wrong NumCPU in kube-proxy under static CPU policy
Signed-off-by: xh4n3 <xyn1016@gmail.com>
2021-03-05 12:38:05 +08:00
Zhang Zhanpeng
10111eb499 Optimized function getProxyMode
Signed-off-by: Zhang Zhanpeng <zhanpeng.zhang@daocloud.io>
2021-02-24 10:17:11 +08:00
Rob Scott
8039cf9bb1
Graduating EndpointSliceProxying to beta for Linux 2020-07-07 14:18:03 -07:00
Vinod K L Swamy
bbd4a07dec
Changes to WinKernel to support EndpointSlices 2020-06-29 14:31:15 -07:00
Vinod K L Swamy
ac3f87346f
KubeProxy and DockerShim changes for Ipv6 dual stack support on Windows
Signed-off-by: Vinod K L Swamy <vinodko@microsoft.com>
2020-06-10 15:36:48 -07:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
cici37
7f4d19167e Move pkg/util/configz to k8s.io/component-base 2020-04-29 12:17:25 -07:00
SataQiu
871b90ba23 kube-proxy: add '--bind-address-hard-fail' flag to treat failure to bind to a port as fatal
Signed-off-by: SataQiu <1527062125@qq.com>
2020-04-02 13:13:10 +08:00
Ted Yu
7a0690cd59 Use ProxierHealthUpdater directly to avoid panic 2020-02-10 09:41:09 -08:00
RainbowMango
9b7d8712cf Add show hidden flag to kube-proxy 2019-12-17 21:46:41 +08:00
Rob Scott
dfa04bfc04
Ensuring EndpointSlices are not used for Windows kube-proxy implementations 2019-12-06 15:39:00 -08:00
Dan Winship
0f10102c16 Better distinguish the two kinds of proxy health check servers
Kube-proxy runs two different health servers; one for monitoring the
health of kube-proxy itself, and one for monitoring the health of
specific services. Rename them to "ProxierHealthServer" and
"ServiceHealthServer" to make this clearer, and do a bit of API
cleanup too.
2019-10-04 10:37:58 -04:00
Kubernetes Prow Robot
9c736445f5
Merge pull request #79846 from aramase/fix-golint-pkg/proxy
Fix golint failures in pkg/proxy
2019-08-23 00:51:17 -07:00
Aleksandr Razumov
2390e242b4
fix typo 2019-08-18 23:59:04 +03:00
Kubernetes Prow Robot
fb5a0e0525
Merge pull request #78204 from stewart-yu/patch-1
get rid of the redundancy field in kube-proxy option
2019-08-07 20:09:17 -07:00
Anish Ramasekar
2878270f5b
Fix golint failures in pkg/proxy
Review feedback - remove alias from imports

fix comments
2019-07-08 11:48:33 -07:00
Vallery Lancey
dc0f14312e Removed deprecated --resource-container flag from kube-proxy. 2019-06-16 08:36:42 -07:00
stewart-yu
da375fb154 get rid of the redundancy field in kube-proxy option 2019-05-24 09:37:06 +08:00
JieJhih Jhang
48f431aae5 os exit when option is true 2019-04-24 16:32:11 +08:00
Kubernetes Prow Robot
2490e035d7
Merge pull request #71735 from dcbw/userspace-proxy-ratelimiting
proxy/userspace: respect minSyncInterval
2019-04-16 19:14:03 -07:00
SataQiu
cc199c74fc fix golint failures of cmd/kube-proxy/app 2019-04-13 06:20:52 +08:00
Dan Williams
4b07f80d20 proxy: consolidate ServicesHandler/EndpointsHandler into ProxyProvider
Proxies should be able to cleanly figure out when endpoints have been synced,
so make all ProxyProviders also implement EndpointsHandler and pass those
through to loadbalancers when required.
2019-04-05 16:16:35 -05:00
Vallery Lancey
cdce2d0ef9 Removed cleanup for non-current kube-proxy modes in newProxyServer() 2019-04-03 15:27:21 -07:00
ksubrmnn
a47e99e37a Add Windows flags for KubeProxyConfiguration 2019-02-05 10:39:23 -08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Weibin Lin
0d57ec2938 reuse func getNodeIP 2018-10-09 10:27:27 +08:00
liangwei
6a048c3b96 Move pkg/proxy/apis/kubeproxyconfig to pkg/proxy/apis/config 2018-08-27 10:30:42 +08:00
Di Xu
b3dfe0c652 nodes: improve handling of erroneous host names 2018-08-01 14:57:25 +08:00
Tim Hockin
79778288de Fix NewProxyServer
Different OSes need different args.  This is not a great fix, but better
than adding an arg to Windows which doesn't need it.
2017-11-22 14:17:10 -08:00
xiangpengzhao
ff36eefd17 Rename kubeproxy config pkg and group. 2017-11-04 11:42:36 +08:00
xiangpengzhao
2b938b985c Use const GroupName instead of hard-code. 2017-11-04 11:38:57 +08:00
xiangpengzhao
5c8c1f43fa move KubeProxyConfiguration out of componentconfig API group 2017-11-04 11:38:57 +08:00
Madhan Raj Mookkandy
f503755e53 Add Windows Kernel Proxy support
Windows Kernel now exposes "Internal Load Balancing"
	using VFP (Virtual Filtering Platform) part of Virtual Switch. An inbuild
	windows service HNS (Host Networking Service) acts as interface to program
	the VFP. VFP is synonymous to iptables in functionality. HNS uses json based
	data as input.

	With the help of the interface available in github.com/Microsoft/hcsshim,
	these APIs are exposed to the world in github to program HNS and use
	the feature.

	*** More info about the changes in this PR ***
	(1) For every endpoint available in the system, an HNS Endpoint is added
	    (1.a) for local endpoints, a local HNS Endpoint would already exist, as part of
            container creation.
	    (1.b) For all remote endpoints, a remote HNS Endpoint is created via HNS

	(2) For every Service, a HNS ILB LoadBalancer is added referring the endpoints
	    created in (1)
		Sample Input to HNS:
		{
 	       "Policies":  [
        	                 {
                	             "ExternalPort":  80,
                        	     "InternalPort":  80,
	                             "Protocol":  6,
        	                     "Type":  "ELB",
                	             "VIPs":  [
                        	                  "11.0.98.129"
                                	      ]
	                         }
        	             ],
	        "References":  [
                           "/endpoints/ca8b877b-ab90-499a-bc0e-7d736c425632",
                           "/endpoints/ee0ef08b-8434-4f8b-b748-393884e77465"
        		]
    		}

	(2-a) This is done for Cluster IP, LoadBalancer Ingress IP, NodePort, External IP

	Following the regular service and endpoint updates,
	the HNS is notified of the updates and the system is kept in sync.
2017-09-14 15:50:47 -07:00