Commit Graph

387 Commits (8f48d762717dfe1f479cfabaabc4fb9261a1bc8f)

Author SHA1 Message Date
xiangpengzhao 2b938b985c Use const GroupName instead of hard-code. 2017-11-04 11:38:57 +08:00
xiangpengzhao 75b9fb28bf auto generated files 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
Kubernetes Submit Queue 676e28ff7a
Merge pull request #54848 from xiangpengzhao/add-ipvsscheduler-testcase
Automatic merge from submit-queue (batch tested with PRs 54906, 54120, 54934, 54915, 54848). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve unit test coverage for kube-proxy configuration.

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
/cc @ncdc 

**Release note**:

```release-note
NONE
```
2017-11-02 23:02:18 -07:00
Kubernetes Submit Queue b006bc5d04
Merge pull request #54120 from m1093782566/fix-proxy-mode
Automatic merge from submit-queue (batch tested with PRs 54906, 54120, 54934, 54915, 54848). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kube-proxy fall back to iptables firstly when unable to load kernel modules

**What this PR does / why we need it**:

Fix kube-proxy fall back to iptables firstly when unable to load kernel modules

**Which issue this PR fixes**: 

fixes #54121

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/kind bug
/sig network
/area kube-proxy
2017-11-02 23:02:10 -07:00
m1093782566 ea930dbe5c fix kube-proxy mode 2017-11-03 09:41:54 +08:00
Kubernetes Submit Queue 9c41f9baf1
Merge pull request #50887 from netroby/patch-1
Automatic merge from submit-queue (batch tested with PRs 55016, 50887). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

If command.Execute() return err, print to stdErr

The current kube-proxy not print error if (execute() failed) . not so good and not so friendly to user.
If print err to stdError, will show us why it failed.
2017-11-02 15:40:15 -07:00
xiangpengzhao 9abf4b1d73 Add test case for validateIPVSSchedulerMethod. 2017-10-31 16:22:05 +08:00
xiangpengzhao 36a3193ca9 Add test case for validateHostPort. 2017-10-31 16:06:32 +08:00
xiangpengzhao cac6db5d94 Add test case for validateClientConnectionConfiguration. 2017-10-31 15:48:02 +08:00
Kubernetes Submit Queue 878814b550
Merge pull request #53973 from m1093782566/validate-sheduler
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

validate ipvs scheduler

**What this PR does / why we need it**:

validate ipvs scheduler options

**Which issue this PR fixes**: 

closes #53975

**Special notes for your reviewer**:

It depends on work of #53780.

**Release note**:

```release-note
NONE
```

/sig network

/area kube-proxy
2017-10-29 23:52:08 -07:00
Kubernetes Submit Queue e44b585151 Merge pull request #54315 from dims/fix-panic-on-kubeproxy-cleanup
Automatic merge from submit-queue (batch tested with PRs 53946, 53993, 54315, 54143, 54532). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kube-proxy panic on cleanup

**What this PR does / why we need it**:

Set the execer properly when we initialize ProxyServer or we will
end up with a panic.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Fixes #54305

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-25 21:20:32 -07:00
Kubernetes Submit Queue 9807360fe3 Merge pull request #53956 from m1093782566/proxy-metrics
Automatic merge from submit-queue (batch tested with PRs 52479, 53956). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Register sync proxy rules latency metrics in app level

**What this PR does / why we need it**:

IMO, should may should register proxy metrics in app level instead of in specific proxy mode, e.g. iptables, ipvs, winkernel...

By registering sync proxy rules latency metrics in app level, we can reuse codes among different proxiers.

**Which issue this PR fixes**: 

closes #53957

**Special notes for your reviewer**:

@wojtek-t What do you think about it?

**Release note**:

```release-note
NONE
```
2017-10-24 00:48:26 -07:00
m1093782566 876c73024c migrate ip cmd to netlink 2017-10-24 13:26:07 +08:00
m1093782566 9dce640213 fix review comments 2017-10-24 10:30:38 +08:00
Davanum Srinivas b370cc1bc6 Fix kube-proxy panic on cleanup
Set the execer properly when we initialize ProxyServer or we will
end up with a panic.
2017-10-20 14:20:22 -04:00
Lion-Wei ee3fbf9c5a add ProxyModeIPVS in proxy mode validation 2017-10-19 14:34:37 +08:00
m1093782566 518936fb5f validate ipvs scheduler 2017-10-17 09:45:28 +08:00
m1093782566 dab9b84b67 add proxy metrics in app level 2017-10-16 21:10:51 +08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 1c17d985ca Merge pull request #52183 from MrHohn/kube-proxy-incluster-host
Automatic merge from submit-queue (batch tested with PRs 52883, 52183, 53915, 53848). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[GCE kube-up] Don't provision kubeconfig file for kube-proxy service account

**What this PR does / why we need it**:

Offloading the burden of provisioning kubeconfig file for kube-proxy service account from GCE startup scripts. This also helps us decoupling kube-proxy daemonset upgrade from node upgrade.

Previous attempt on https://github.com/kubernetes/kubernetes/pull/51172, using InClusterConfig for kube-proxy based on discussions on https://github.com/kubernetes/client-go/issues/281.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #NONE 

**Special notes for your reviewer**:
/assign @bowei @thockin 
cc @luxas @murali-reddy

**Release note**:

```release-note
NONE
```
2017-10-13 17:33:31 -07:00
Zihong Zheng bc9d4ad66e Allow kube-proxy using InClusterConfig() 2017-10-13 14:40:35 -07:00
Kubernetes Submit Queue a9264728d7 Merge pull request #53786 from xiangpengzhao/remove-func
Automatic merge from submit-queue (batch tested with PRs 53776, 53786, 53352, 51567). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Clean up unused func checkKnownProxyMode

**What this PR does / why we need it**:
Minor cleanup.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-12 19:27:34 -07:00
xiangpengzhao 991a75e1e3 Clean up unused func checkKnownProxyMode 2017-10-12 16:40:52 +08:00
Davanum Srinivas 3c9fd43385 Parse cluster-cidr only if it is specified
In iptables/proxier.go, there is code to check the length of the
CIDR and setup nat/iptables only if the length of the string is
greater than zero. However in PR #49087, strong validation was
added so kube proxy currently bails out and basically mandates
a valid cidr has to be specified. Let us go back to the earlier
behavior.
2017-10-11 16:48:51 -04:00
Joe Heck c629ec961c clarifying CLI output
backporting documentation changes made to generated CLI documentation
so that the source is correct for updates to the documentation and
kubernetes website. This is part of what is needed to resolve
https://github.com/kubernetes/kubernetes.github.io/issues/5618
and is updated based on review feedback while fixing that bug at
https://github.com/kubernetes/kubernetes.github.io/pull/5824
2017-10-10 11:56:06 -07:00
allencloud fd82adb012 validate kube-proxy options
Signed-off-by: allencloud <allen.sun@daocloud.io>
Signed-off-by: Allen Sun <allen.sun@daocloud.io>
2017-10-09 14:12:15 +08:00
Kubernetes Submit Queue db614dea24 Merge pull request #53044 from Mashimiao/kube-proxy-dep-fix
Automatic merge from submit-queue (batch tested with PRs 53044, 52956, 53512, 53028). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix wrong deprecated option info

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>

**What this PR does / why we need it**:
`--cleanup-iptables` is replaced by `--cleanup` not `--cleanup-proxyrules`

**Release note**:
```
None
```
2017-10-05 18:29:37 -07:00
Kubernetes Submit Queue daa0d81703 Merge pull request #52614 from leblancd/v6_proxy_bind_address
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add check for IPv6 '::' when calculating kube-proxy's node IP

kube-proxy currently checks for a bind address of 0.0.0.0 (IPv4 all-zeros)
when calculating kube-proxy's node IP, but it does not check for
an address of '::' (IPv6 all-zeros). For either of those all-zeros
addresses, the node IP should be determined based on the hostname,
rather than using the address directly.

Also added a helpful log message when the kube-proxy protocol is
determined to be IPv6.

fixes #52613



**What this PR does / why we need it**:
This PR adds a check for a bind address of IPv6 '::' (all zeros) when kube-proxy is calculating its node IP,
similar to what is done for a bind address of IPv4 0.0.0.0. For either of these all-zeros addresses,
kube-proxy should derive the node IP based on the hostname, rather than use the bind address
directly.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #52613

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-04 19:55:04 -07:00
Kubernetes Submit Queue 1cd6a50809 Merge pull request #47640 from xiangpengzhao/fix-bin-ver
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add version info to kube-scheduler, kube-proxy and kubelet logs.

**What this PR does / why we need it**:
#46047 add such info to apiserver and CM. This adds version info to other binaries.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: related to #46047 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-28 20:02:59 -07:00
Ma Shimiao bd6c0d2b55 Fix wrong deprecated option info in
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-09-26 16:07:31 +08:00
Dane LeBlanc 6d71eb590b Add check for IPv6 '::' when calculating kube-proxy's node IP
kube-proxy currently checks for a bind address of 0.0.0.0 (IPv4 all-zeros)
when calculating kube-proxy's node IP, but it does not check for
an address of '::' (IPv6 all-zeros). For either of those all-zeros
addresses, the node IP should be determined based on the hostname,
rather than using the address directly.

Also added a helpful log message when the kube-proxy protocol is
determined to be IPv6.

fixes #52613
2017-09-25 17:54:57 -04:00
Kubernetes Submit Queue bc6d20cf33 Merge pull request #52403 from m1093782566/ut-ipvs-config
Automatic merge from submit-queue (batch tested with PRs 52355, 52537, 52551, 52403, 50673). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Clear TODO: Adding UT for loading ipvs config

**What this PR does / why we need it**:

Clear TODO: Adding UT for loading ipvs config

**Which issue this PR fixes**: 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-23 15:27:00 -07:00
xiangpengzhao af09159419 Add version info to kube-scheduler, kube-proxy and kubelet logs. 2017-09-21 17:46:24 +08:00
Madhan Raj Mookkandy a8d797afdd Add exception to golint check
(*) Fix cleanup of NodePort resources. (*) Fix the logic to select existing policies

Fix review comment

Fix Bazel

Update GoDep License

Fix NodePort forwarding to target port

Fix Darwin Build break. +1

Implement IsCompatible to validate kernel support for kernel mode
2017-09-18 11:11:22 -07:00
Madhan Raj Mookkandy 63020d5f72 Vendor changes
Vendoring (NEW) in github.com/Microsoft/hcsshim
2017-09-14 16:00:07 -07:00
Madhan Raj Mookkandy 5b87513972 Fix Bazel build 2017-09-14 15:50:47 -07: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
m1093782566 8487b1653e ut test load ipvs config 2017-09-13 17:03:26 +08:00
Kubernetes Submit Queue ad23559049 Merge pull request #47054 from caseydavenport/fix-masq-all
Automatic merge from submit-queue

Improve description for --masquerade-all and --cluster-cidr flags

**What this PR does / why we need it**:

Improves the help text for the kube-proxy's `--masquerade-all` and `--cluster-cidr` flags, which previously were vague and confusing.

Fixes https://github.com/kubernetes/kubernetes/issues/47213

```release-note
NONE
```
2017-08-30 01:36:25 -07:00
m1093782566 5ed2b44ca7 implement ipvs mode of kube-proxy
Conflicts:
	pkg/util/ipvs/ipvs_unsupported.go
2017-08-30 10:03:02 +08:00
Casey Davenport 3003ab7ad2 Improve --cluster-cidr description 2017-08-29 16:40:02 -07:00
Casey Davenport 589b8ac833 Improve description for --masquerade-all flag 2017-08-29 16:40:02 -07:00
sakeven fac27d1ed4 [kube-proxy] Use glog instaed of fmt.Printf
Signed-off-by: sakeven <jc5930@sina.cn>
2017-08-28 15:58:17 +08:00
huzhifeng 3196300fc2
Run go fmt
Signed-off-by: huzhifeng <huzhifeng@douyu.tv>
2017-08-18 16:03:25 +08:00
netroby ac2729ed0a If command.Execute() return err, print to stdErr 2017-08-18 13:05:58 +08:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Kubernetes Submit Queue 0c2f816646 Merge pull request #48237 from xiangpengzhao/fix-proxy-test
Automatic merge from submit-queue

Add test for kube-proxy running with "--cleanup-iptables=true"

**What this PR does / why we need it**:
Add test to prevent such kube-proxy panic to happen again.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #48177

**Special notes for your reviewer**:
Forgot to add this in last PR #48183. Should we also add this to v1.7 milestone?
/cc @ncdc @dchen1107 

**Release note**:

```release-note
NONE
```
2017-08-03 22:03:31 -07:00
Kubernetes Submit Queue acc00afece Merge pull request #49267 from MrHohn/kube-proxy-abort-when-healthz-fails
Automatic merge from submit-queue (batch tested with PRs 49992, 48861, 49267, 49356, 49886)

Emit event and retry when fail to start healthz server on kube-proxy

**What this PR does / why we need it**: Enhance kube-proxy's logic when fail to start healthz server.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: From #49263.

**Special notes for your reviewer**:
/assign @thockin @nicksardo @bowei 

**Release note**:

```release-note
NONE
```
2017-08-02 05:16:01 -07:00
Zihong Zheng db379de778 Emit event and retry when fail to start healthz server on kube-proxy. 2017-07-27 20:54:51 -07:00
supereagle edce96c5b6 use the core client with version 2017-07-26 19:16:02 +08:00
supereagle adc0eef43e remove duplicated import and wrong alias name of api package 2017-07-25 10:04:25 +08:00
Kubernetes Submit Queue 40249c061f Merge pull request #49366 from gmarek/coreEvents
Automatic merge from submit-queue

Explicitly use Core() client when creating eventClint

@sttts
2017-07-21 04:20:38 -07:00
gmarek 45b47c7faa Explicitly use Core() client when creating eventClint 2017-07-21 11:22:56 +02:00
ymqytw 9b393a83d4 update godep 2017-07-20 11:03:49 -07:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Kubernetes Submit Queue cb1f42ad18 Merge pull request #49137 from deads2k/proxier-01-really-nil
Automatic merge from submit-queue (batch tested with PRs 49058, 49072, 49137, 49182, 49045)

check for nil value in interface for proxier health

golang allows for a non-nil interface to have a nil value (not type).  This results in an NPE at runtime.

@sttts remember that bit about go?  Trivia becomes real :(
2017-07-19 10:27:25 -07:00
deads2k 6d21f37aee check for nil value in interface for proxier health 2017-07-19 08:13:52 -04:00
Kubernetes Submit Queue 495f5b261f Merge pull request #49139 from deads2k/cli-15-proxy-defaults
Automatic merge from submit-queue (batch tested with PRs 48043, 48200, 49139, 36238, 49130)

expose method to allow externally setting defaults on an external type

The options are an exposed type.  This allows you to set the defaults on them.

@derekwaynecarr who normally owns this bit?
2017-07-19 01:57:30 -07:00
deads2k 41a4faa611 expose method to allow externally setting defaults on an external type 2017-07-18 13:56:25 -04:00
xiangpengzhao 01daf707c5 Refactor: pkg/util into sub-pkgs 2017-07-18 14:34:08 +08:00
xiangpengzhao c685df7a6a Add test for kube-proxy running with "--cleanup-iptables=true" 2017-07-17 16:44:46 +08:00
Kubernetes Submit Queue e8eb858b2a Merge pull request #47187 from leblancd/v6_only_proxy_server
Automatic merge from submit-queue (batch tested with PRs 47309, 47187)

Add IPv6 test cases to kube-proxy server test.

**What this PR does / why we need it**: This change adds some IPv6 test cases for the kube-proxy server. Also adds some test cases for negative conditions for better test coverage.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #47313

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-07-16 20:00:56 -07:00
Zihong Zheng a4e359aa12 Make kube-proxy's MetricsBindAddress configurable via flag 2017-07-07 12:46:20 -07:00
xiangpengzhao f12dc94fa9
Fix kube-proxy panic when running with "--cleanup-iptables=true" 2017-06-28 16:43:00 +08:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f2d3220a11 run root-rewrite-import-client-go-api-types 2017-06-22 11:30:59 -07:00
Kubernetes Submit Queue 117b6248ef Merge pull request #46678 from tacy/fix46039
Automatic merge from submit-queue

fix#46039: iptables proxier need use '--bind-address' if set

**What this PR does / why we need it**: 
iptables proxier need use '--bind-address' if set

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #46039 

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-06-12 20:11:22 -07:00
Dane LeBlanc c2cb2b3c71 Add IPv6 test cases to kube-proxy server test.
fixes #47313
2017-06-12 13:05:47 -04:00
Jeff Grafton 64bd79fad7 Convert go_binary linkstamp to x_defs 2017-06-08 14:59:55 -07:00
lichunlong dc768c87c3 fix review 2017-06-02 15:32:22 +08:00
Tim Hockin 862b165427 Proxy: comments on --masquerade-all flag 2017-06-01 12:36:31 -07:00
lichunlong 63bc96e1b0 fix review 2017-06-01 17:22:41 +08:00
lichunlong 58d0596c23 fix review 2017-05-31 21:48:53 +08:00
lichunlong 1965157b49 fix#46039: iptables proxier need use '--bind-address' if set 2017-05-31 13:35:55 +08:00
Zihong Zheng ad437e9ce2 Add /healthz back to kube-proxy metrics server 2017-05-26 11:53:43 -07:00
Andy Goldstein f51c2c445c Restore kube-proxy --version 2017-05-19 14:40:35 -04:00
Andy Goldstein 032e2f6652 kube-proxy: add --write-config flag
Add --write-config flag to kube-proxy to write the default configuration
values to the specified file location.
2017-05-18 10:34:22 -04:00
Wojciech Tyczynski 45ed99c3a6 Add syncProxyRules prometheus metric 2017-05-17 19:26:58 +02:00
Wojciech Tyczynski e35b1c21a1 Expose /metrics and /debug/pprof from kube-proxy 2017-05-17 19:23:58 +02:00
Chao Xu 14045d253d hack/update-bazel.sh 2017-05-11 15:59:04 -07:00
Chao Xu c354076aa4 remove invocation of k8s.io/client-go/pkg/api/install
change import of client-go/api/helper to kubernetes/api/helper

remove unnecessary use of client-go/api.registry

change use of client-go/pkg/util to kubernetes/pkg/util

remove dependency on client-go/pkg/apis/extensions

remove unnecessary invocation of k8s.io/client-go/extension/intsall

change use of k8s.io/client-go/pkg/apis/authentication to v1
2017-05-11 15:03:46 -07:00
Wojciech Tyczynski ce752e3fc9 Remove no-longer used code in proxy/config 2017-05-10 12:16:35 +02:00
Wojciech Tyczynski 57d35d5acb Switch winuserspace proxy to be event based for services 2017-05-10 12:14:37 +02:00
Kubernetes Submit Queue 332b095ca9 Merge pull request #44968 from MrHohn/kube-proxy-healthcheck
Automatic merge from submit-queue (batch tested with PRs 44727, 45409, 44968, 45122, 45493)

Separate healthz server from metrics server in kube-proxy

From #14661, proposal is on kubernetes/community#552.

Couple bullet points as in commit:
- /healthz will be served on 0.0.0.0:10256 by default.
- /metrics and /proxyMode will be served on port 10249 as before.
- Healthz handler will verify timestamp in iptables mode.

/assign @nicksardo @bowei @thockin 

**Release note**:

```release-note
NONE
```
2017-05-08 14:54:38 -07:00
Zihong Zheng e5db5dc3a1 Autogenerated files 2017-05-05 14:44:38 -07:00
Zihong Zheng ca59d909cf Separate healthz server from metrics server in kube-proxy
- /healthz will be served on 0.0.0.0:10256 by default.
- /metrics and /proxyMode will be served on port 10249
  as before.
- Healthz handler will verify timestamp in iptables mode.
2017-05-05 14:43:44 -07:00
Wojciech Tyczynski 33a7a288a5 Switch userspace proxy to be event based for services 2017-05-05 09:35:38 +02:00
Kubernetes Submit Queue 10704b2ae1 Merge pull request #44919 from kinvolk/robertgzr/kubeproxy-check-conntrack-before-write
Automatic merge from submit-queue

[WIP] Skip resize of nf_conntrack/parameters/hashsize if not necessary

**What this PR does / why we need it**:
Linux does not support writing to `/sys/module/nf_conntrack/parameters/hashsize` when the writer process is not in the initial network namespace
(https://github.com/torvalds/linux/blob/v4.10/net/netfilter/nf_conntrack_core.c#L1795-L1796).

Usually that's fine. But in some configurations such as with https://github.com/kinvolk/kubeadm-nspawn, kube-proxy is in another netns.

Therefore, check if writing in hashsize is necessary and skip the writing if not.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-03 23:25:31 -07:00
Andy Goldstein 43cb024402 Add kube-proxy config file support
Add support for configuring kube-proxy via a config file instead of
command line flags.
2017-05-01 18:02:47 -04:00
Kubernetes Submit Queue 14a557b1a2 Merge pull request #44346 from mikedanese/build-static
Automatic merge from submit-queue (batch tested with PRs 41106, 44346, 44929, 44979, 45027)

bazel: statically link dockerized components
2017-04-27 12:11:00 -07:00
Robert Günzler b397e16669 Skip resize of nf_conntrack/parameters/hashsize if not necessary 2017-04-25 16:08:30 +02:00
Kubernetes Submit Queue 20dd848e7c Merge pull request #44204 from FengyunPan/optimize-code
Automatic merge from submit-queue

Optimize getProxyMode() to get proxy mode

1. getProxyMode() does not need nodeGetter args after remove
   proxy-mode annotation.
2. we should get error when the version of iptables less than
   MinVersion.
2017-04-21 18:11:07 -07:00
Wojciech Tyczynski 7a647f9d1a Event-based iptables proxy for services 2017-04-18 13:30:59 +02:00
Mike Danese 3757e8bb5c bazel: statically link dockerized components
and remove libc from docker images when it's not needed.
2017-04-14 15:51:54 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
FengyunPan b95b95dc00 Optimize getProxyMode() to get proxy mode
The getProxyMode() does not need nodeGetter args after remove
proxy-mode annotation.
2017-04-13 09:44:30 +08:00
Wojciech Tyczynski af710835fa Remove deprecated code from proxy/config 2017-04-12 11:17:49 +02:00
Wojciech Tyczynski c3e9467b63 Edge-based winuserspace proxy 2017-04-12 11:10:34 +02:00
Kubernetes Submit Queue 284615d79d Merge pull request #43702 from wojtek-t/edge_based_proxy
Automatic merge from submit-queue

Edge-based userspace LB in kube-proxy

@thockin @bowei - if one of you could take a look if that PR doesn't break some basic kube-proxy assumptions. The similar change for winuserproxy should be pretty trivial.

And we should also do that for iptables, but that requires splitting the iptables code to syncProxyRules (which from what I know @thockin already started working on so we should probably wait for it to be done).
2017-04-12 00:30:53 -07:00
Wojciech Tyczynski b1475565e6 Edge-based iptables proxy 2017-04-10 13:12:45 +02:00
Wojciech Tyczynski c5cbdbe3d2 Edge-based userspace proxy 2017-04-10 11:59:21 +02:00
Wojciech Tyczynski f7c06ad23c Support endpoints event handlers in kube-proxy 2017-04-10 11:59:21 +02:00
Mike Danese ba5c2855b3 bazel: implement git build stamping 2017-04-05 11:47:39 -07:00
Andy Goldstein d2bc4d0b2e Use shared informers for proxy endpoints and service configs
Use shared informers instead of creating local controllers/reflectors
for the proxy's endpoints and service configs. This allows downstream
integrators to pass in preexisting shared informers to save on memory &
cpu usage.

This also enables the cache mutation detector for kube-proxy for those
presubmit jobs that already turn it on.
2017-04-04 12:51:41 -04:00
Tim Hockin adf30aa2e1 kube-proxy: OnServiceUpdate takes pointers
This signature is more consistent with OnEndpointsUpdate and removes a
copy loop.  This is part on ongoing cleanup to rate-limit iptables
calls.
2017-04-03 17:19:39 -07:00
Wojciech Tyczynski 7ce368ccd2 Simplify proxy config for Services by removing Mux. 2017-03-26 11:07:36 +02:00
Wojciech Tyczynski 596527dafa Simplify proxy config for Endpoints by removing Mux. 2017-03-26 11:07:36 +02:00
Kubernetes Submit Queue 0796d5c0d8 Merge pull request #29465 from DirectXMan12/feature/extensible-proxysocket
Automatic merge from submit-queue

Extensible Userspace Proxy

This PR refactors the userspace proxy to allow for custom proxy socket implementations.
It changes the the ProxySocket interface to ensure that other packages can properly implement it (making sure all arguments are publicly exposed types, etc), and adds in a mechanism for an implementation to create an instance of the userspace proxy with a non-standard ProxySocket.
Custom ProxySockets are useful to inject additional logic into the actual proxying.  For example, our idling proxier uses a custom proxy socket to hold connections and notify the cluster that idled scalable resources need to be woken up.

Also-Authored-By: Ben Bennett bbennett@redhat.com
2017-03-01 09:17:29 -08:00
Kubernetes Submit Queue ef852f9301 Merge pull request #41487 from anhowe/anhowe-windowsproxy
Automatic merge from submit-queue (batch tested with PRs 42200, 39535, 41708, 41487, 41335)

Update kube-proxy support for Windows

**What this PR does / why we need it**:

The kube-proxy is built upon the sophisticated iptables NAT rules.  Windows does not have an equivalent capability.  This introduces a change to the architecture of the user space mode of the Windows version of kube-proxy to match the capabilities of Windows.

The proxy is organized around service ports and portals.  For each service a service port is created and then a portal, or iptables NAT rule, is opened for each service ip, external ip, node port, and ingress ip.  This PR merges the service port and portal into a single concept of a "ServicePortPortal" where there is one connection opened for each of service IP, external ip, node port, and ingress IP.

This PR only affects the Windows kube-proxy.  It is important for the Windows kube-proxy because it removes the limited portproxy rule and RRAS service and enables full tcp/udp capability to services.

**Special notes for your reviewer**:

**Release note**:

```
Add tcp/udp userspace proxy support for Windows.
```
2017-02-28 20:16:10 -08:00
Benjamin Bennett 5447db3048 Userspace proxy should remove conntrack entries
This changes the userspace proxy so that it cleans up its conntrack
settings when a service is removed (as the iptables proxy already
does).  This could theoretically cause problems when a UDP service
as deleted and recreated quickly (with the same IP address).  As
long as packets from the same UDP source IP and port were going to
the same destination IP and port, the the conntrack would apply and
the packets would be sent to the old destination.

This is astronomically unlikely if you did not specify the IP address
to use in the service, and even then, only happens with an "established"
UDP connection.  However, in cases where a service could be "switched"
between using the iptables proxy and the userspace proxy, this case
becomes much more frequent.
2017-02-27 18:41:47 -05:00
Piotr Szczesniak 179cef3ca3 Export Prometheus metrics in kube-proxy 2017-02-25 16:48:43 +01:00
Anthony Howe 48647fb9b5 add tcp or udp proxy for service addresses 2017-02-22 19:42:33 -08:00
deads2k 78d8a8efa8 copy pkg/util/logs to apiserver 2017-02-13 12:07:15 -05:00
Klaus Ma f6aa8bbb8f Updated NodeRef to clientv1.ObjectReference. 2017-02-07 06:27:06 +08:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
Christoph Blecker a9dfd254c7
Remove proxy-mode annotation from kube-proxy
This removes the net.experimental.kubernetes.io/proxy-mode and net.beta.kubernetes.io/proxy-mode annotations from kube-proxy.
2017-01-28 09:12:28 -08:00
Dr. Stefan Schimanski 2b8e938128 Update generated files 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski 82826ec273 pkg/util/flag: move to k8s.io/apiserver 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski a6b2ebb50c pkg/flag: make feature gate extensible and split between generic and kube 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski 56d60cfae6 pkg/util: move flags from pkg/util/config to pkg/util/flags 2017-01-24 20:56:03 +01:00
deads2k 335ef747d6 mechanical 2017-01-23 10:03:55 -05:00
Kubernetes Submit Queue ac857a5ade Merge pull request #40106 from deads2k/client-09-switch
Automatic merge from submit-queue

make client-go more authoritative

Builds on https://github.com/kubernetes/kubernetes/pull/40103

This moves a few more support package to client-go for origination.  
 1. restclient/watch - nodep
 1. util/flowcontrol - used interface
 1. util/integer, util/clock - used in controllers and in support of util/flowcontrol
2017-01-19 06:34:49 -08:00
deads2k cdb2934bbc remove kubernetes copy of clientcmd types 2017-01-19 07:39:19 -05:00
Dr. Stefan Schimanski 3d9449a353 genericapiserver: fix imports 2017-01-19 13:06:47 +01:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Kubernetes Submit Queue 5aa177a81f Merge pull request #37054 from tanshanshan/remove-repeat1
Automatic merge from submit-queue (batch tested with PRs 39695, 37054, 39627, 39546, 39615)

remove repeating const declaration

**What this PR does / why we need it**:

remove repeating const declaration  , and avoid const declaration in  loop

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-01-10 18:57:22 -08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
deads2k 4d7fcae85a mechanicals 2017-01-05 11:14:27 -05:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Kubernetes Submit Queue 64c21133f0 Merge pull request #39142 from k82cn/k8s_39136
Automatic merge from submit-queue (batch tested with PRs 39152, 39142, 39055)

Update NodeRef to v1.ObjectReference.

fixes #39136
2016-12-27 17:10:13 -08:00
Klaus Ma b0dfa4ad47 Add event when failed to open local port. 2016-12-23 04:51:12 +08:00
Klaus Ma e901800687 Update NodeRef to v1.ObjectReference. 2016-12-22 16:28:20 +08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Wojciech Tyczynski aa7da5231f Update bazel files 2016-12-09 09:42:02 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
caiyixiang da46d1cf51 correct a few spelling mistakes 2016-12-01 16:34:25 +08:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu 643f0bbd34 other cmd/ 2016-11-23 15:53:09 -08:00
tanshanshan 2e0ea0bf8f remove repeat const declaration 2016-11-22 16:46:51 +08:00
Patrice Ferlet 439a03136f Check sysfs Type instead of Device
Some distribution, or installation use "none" device to mount sysfs (eg. Scaleway VPS). We should check the mount type instead of device.

Fix #37183
2016-11-21 14:56:10 +01:00
Kubernetes Submit Queue c52efa570d Merge pull request #36079 from apprenda/windows_kube_proxy
Automatic merge from submit-queue

Add Windows support to kube-proxy

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
This is the first stab at supporting kube-proxy (userspace mode) on Windows

**Which issue this PR fixes** : 
fixes #30278

**Special notes for your reviewer**:
The MVP uses `netsh portproxy` to redirect traffic from `ServiceIP:ServicePort` to a `LocalIP:LocalPort`. 
For the next version we are expecting to have guidance from Microsoft Container Networking team.

**Limitations**:
Current implementation does not support DNS queries over UDP as `netsh portproxy` currently only supports TCP. We are working with Microsoft to remediate this.

cc: @brendandburns @dcbw 

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-11-09 01:26:27 -08:00
Vishnu kannan dd8ec911f3 Revert "Revert "Merge pull request #35821 from vishh/gci-mounter-scope""
This reverts commit 402116aed4.
2016-11-08 11:09:10 -08:00
Paulo Pires 23c35f24c7
Added automatic seletion of userspace proxy mode depending on the OS kube-proxy is running. 2016-11-07 09:11:35 +00:00
Zihong Zheng 55f75c37f7 Default to the old behavior for proxier sync. 2016-11-06 22:45:53 -08:00
Timothy St. Clair 2b012e822a Add minimum iptables sync period to the proxy, default is 2/sec 2016-11-04 00:38:35 -05:00
Bowei Du a06fc6ab7a Adds TCPCloseWaitTimeout option to kube-proxy for sysctl nf_conntrack_tcp_timeout_time_wait
Fixes issue-32551
2016-11-03 22:07:02 -07:00
saadali 402116aed4 Revert "Merge pull request #35821 from vishh/gci-mounter-scope"
This reverts commit 973fa6b334, reversing
changes made to 41b5fe86b6.
2016-11-03 20:23:25 -07:00
Kubernetes Submit Queue 973fa6b334 Merge pull request #35821 from vishh/gci-mounter-scope
Automatic merge from submit-queue

[Kubelet] Use the custom mounter script for Nfs and Glusterfs only

This patch reduces the scope for the containerized mounter to NFS and GlusterFS on GCE + GCI clusters

This patch also enabled the containerized mounter on GCI nodes

Shepherding multiple PRs through the submit queue is painful. Hence I combined them into this PR. Please review each commit individually.

cc @jingxu97 @saad-ali

https://github.com/kubernetes/kubernetes/pull/35652 has also been reverted as part of this PR
2016-11-03 04:32:19 -07:00