Commit Graph

76 Commits (56dc8f9a6ab09debeddf5349ee26730d3e9107f8)

Author SHA1 Message Date
Kubernetes Submit Queue 3256546a79
Merge pull request #56948 from MrHohn/esipp-remove-feature-gate
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>.

Remove ExternalTrafficLocalOnly from kube_feature gate

*What this PR does / why we need it**:
This PR is for v1.10.

External Source IP Preservation (ESIPP) had been promoted to GA since 1.7. Following the proposal on https://github.com/kubernetes/kubernetes/issues/46404#issuecomment-303939180, we should be able to remove it from feature gate now.

Added release note to announce this.

Also ref the previous attempt: https://github.com/kubernetes/kubernetes/pull/45857.

**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 #56645

**Special notes for your reviewer**:

**Release note**:

```release-note
"ExternalTrafficLocalOnly" has been removed from feature gate. It has been a GA feature since v1.7.
```
2018-01-19 00:35:01 -08:00
Kubernetes Submit Queue 684f85e61f
Merge pull request #57868 from Lion-Wei/ipvs-5
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>.

fix ipvs proxy mode kubeadm usage

**What this PR does / why we need it**:
Fix ipvs proxy mode usage of kubeadm in ipvs README file.

**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 # 

**Release note**:
```release-note
NONE
```
2018-01-18 12:28:11 -08:00
Lion-Wei 9abb316006 fix ipvs proxy mode kubeadm usage 2018-01-11 11:18:38 +08:00
Kubernetes Submit Queue 7585998299
Merge pull request #57317 from m1093782566/notfound
Automatic merge from submit-queue (batch tested with PRs 57906, 57425, 56939, 57317, 57762). 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 "Not Found" error for ipset set & entry delete

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

Add "not found error" for ipset set and entry delete. For example,

```
[root@SHA1000130405 k8s-yml]# ipset list
Name: KUBE-LOOP-BACK
Type: hash:ip,port,ip
Revision: 2
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 16776
References: 1
Members:
172.17.0.2,udp:53,172.17.0.2
172.17.0.2,tcp:53,172.17.0.2
100.106.89.164,tcp:6443,100.106.89.164

[root@SHA1000130405 k8s-yml]# ipset delete foo
ipset v6.19: The set with the given name does not exist

[root@SHA1000130405 k8s-yml]# ipset del KUBE-LOOP-BACK 1.2.3.4,tcp:80,1.2.3.4
ipset v6.19: Syntax error: Third element is missing from 1.2.3.4,tcp:80,1.2.3.4.
```
Just need to filter the error message "does not exist" or "element is missing". We should ignore these error when try to make sure they are deleted.

**Which issue(s) this PR fixes**:
Fixes #57318

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-05 17:52:41 -08:00
Kubernetes Submit Queue 2602722bd0
Merge pull request #57699 from m1093782566/test-sync
Automatic merge from submit-queue (batch tested with PRs 57699, 57657). 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 ipvs virutal server update

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

Fix ipvs virutal server update.

**Which issue(s) this PR fixes**:
Fixes #57698 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-02 21:44:40 -08:00
Lion-Wei 93952fb39e create ipvs clusterIP rules in onlyNodeLocalEndpoints mode 2018-01-02 19:54:30 +08:00
m1093782566 9cae364ce7 add test for syncvirtualServer 2017-12-30 12:51:59 +08:00
m1093782566 e2918f0801 fix ipvs virutal server update 2017-12-29 14:38:40 +08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue 263fa7856a
Merge pull request #57429 from m1093782566/syscall-unix
Automatic merge from submit-queue (batch tested with PRs 57292, 56274, 57435, 57438, 57429). 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>.

replace syscall with sys/unix pkg in ipvs/netlink call

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

This PR replaces syscall with sys/unix pkg in ipvs/netlink call as the Go doc for syscall says:

	NOTE: This package is locked down.
	Code outside the standard Go repository should be migrated to use the corresponding package in the golang.org/x/sys repository.
	That is also where updates required by new systems or versions should be applied.
	See https://golang.org/s/go1.4-syscall for more information.

**Which issue(s) this PR fixes**:
Fixes  #57430

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @thockin @brendandburns
2017-12-20 22:16:51 -08:00
m1093782566 15f427ac2c fix ipvs/proxier_test.go compile error 2017-12-20 15:54:07 +08:00
m1093782566 6a5990caa0 add tests in ipvs/ipset_test.go 2017-12-20 15:53:43 +08:00
m1093782566 c26912cd1e update bazel BUILD 2017-12-20 10:57:58 +08:00
m1093782566 cddc479904 replace syscall with sys/unix pkg 2017-12-20 10:08:09 +08:00
m1093782566 89e70760d7 log error when error occur in CleanupLeftovers() 2017-12-19 19:10:01 +08:00
m1093782566 e6b9b5e0c3 add not found error for ipset set and entry delete 2017-12-18 18:36:32 +08:00
m1093782566 22a4edcd72 update bazel BUILD 2017-12-18 11:03:29 +08:00
m1093782566 8c4bfd0ca3 add fake ut 2017-12-18 11:03:22 +08:00
m1093782566 094eaf4249 test get node IP 2017-12-18 11:03:15 +08:00
m1093782566 a9b67a4b52 fix ipvs proxier nodeport 2017-12-16 16:26:39 +08:00
Kubernetes Submit Queue bb94058b4f
Merge pull request #56390 from m1093782566/test-mode
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>.

Test Proxy Mode

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

Currently, IPVS-based kube-proxy is protected by feature gateway and there is no UT for it. We should test ipvs proxy mode when feature gateway is set.

**Which issue(s) this PR fixes**:
Fixes #56404

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-15 21:59:32 -08:00
Kubernetes Submit Queue be4f638ce7
Merge pull request #56037 from m1093782566/cleanup-deadcode
Automatic merge from submit-queue (batch tested with PRs 55954, 56037, 55866, 55984, 54994). 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>.

remove dead code

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

remove dead code in IPVS kube-proxy

**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**:

**Release note**:

```release-note
NONE
```

/assign @thockin
2017-12-13 23:25:52 -08:00
Kubernetes Submit Queue 9a03e7e17d
Merge pull request #56325 from m1093782566/ipvs-readme
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>.

Update IPVS README

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

People complained that they feel confused about how to use IPVS-based kube-proxy correctly, probably we may need to provide them a better README.

**Which issue(s) this PR fixes**: 

xref: #56319

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-13 19:32:11 -08:00
Zihong Zheng 9ab98d9f69 Remove ExternalTrafficLocalOnly from kube_feature gate 2017-12-07 21:25:11 -08:00
Vincent Palmer 8961f69c7e Fixed typo 2017-11-29 16:01:26 +01:00
m1093782566 dc2e57ba74 refactor canUseIPVSMode and test it 2017-11-27 20:06:47 +08:00
m1093782566 f55c1ea78e update IPVS readme 2017-11-24 16:16:26 +08:00
m1093782566 f3e744b661 add cleanup-ipvs flag 2017-11-21 15:05:23 +08:00
m1093782566 99a789c668 remove dead code 2017-11-20 16:49:53 +08:00
Kubernetes Submit Queue 3df3c580b7
Merge pull request #54219 from m1093782566/ipset
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>.

Using ipset doing SNAT and packet filter in IPVS kube-proxy

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

Try ipset in ipvs proxy mode.

**Which issue this PR fixes**: 

fixes #54203

xref: #53393, #53775

**Special notes for your reviewer**:

**Release note**:

```release-note
Using ipset doing SNAT and packet filtering in IPVS kube-proxy
```

/sig network

/area kube-proxy
2017-11-19 22:09:13 -08:00
Kubernetes Submit Queue 5e178936a1
Merge pull request #53780 from m1093782566/validate-ipvs
Automatic merge from submit-queue (batch tested with PRs 53780, 55663, 55321, 52421, 55659). 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 kube-proxy options

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

Validate ipvs proxy options

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-15 09:30:24 -08:00
m1093782566 fbf8a13376 use ipset doing snat and packet filter in ipvs proxy 2017-11-15 18:02:58 +08:00
m1093782566 c124fcf7d7 wrap ipset in proxy ipvs 2017-11-15 17:20:01 +08:00
Kubernetes Submit Queue cae7240cf9
Merge pull request #55601 from m1093782566/getlocalips
Automatic merge from submit-queue (batch tested with PRs 55009, 55532, 55601, 52569, 55533). 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 ipvs/proxy getLocalIPs inconsistency with iptables/proxy

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

* Fix ipvs/proxy `getLocalIPs()` inconsistency with iptables/proxy

* validate the ip address before pkg/proxy/util IPPart() return ip string.

**Which issue(s) this PR fixes** :
Fixes #55612

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-14 00:09:52 -08:00
m1093782566 42832e7666 fix ipvs proxier getLocalIPs() error 2017-11-13 17:55:53 +08:00
m1093782566 83ada5c7bf replace sets.List() with sets.UnsortedList() 2017-11-13 10:20:54 +08:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Kubernetes Submit Queue 11fc906c2b
Merge pull request #54052 from m1093782566/netlink
Automatic merge from submit-queue (batch tested with PRs 55247, 55324, 55261, 55147, 54052). 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>.

Implement dummy device operation by netlink for ipvs proxier

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

Currently, we implement network interface operations, e.g. create a dummy device and delete a dummy interface via ip cmd and then collect the exist code. For example, we assume the following command:
```
ip link add kube-ipvs0 type dummy 
```
returns 2 means the dummy device `kube-ipvs0` exists, see https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/ipvs/proxier.go#L1529 .

However, from the man page of ip command, exit status 2 just means an error was reported by the kernel, see http://man7.org/linux/man-pages/man8/ip.8.html#EXIT_STATUS.

So, that's a bug.

This PR implements dummy device operation by netlink for ipvs proxier so that can get ride of ip command operations.

**Which issue this PR fixes**: 

fixes #54054

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/sig network
/area kube-proxy
/kind bug
2017-11-09 00:59:32 -08:00
Lion-Wei a05cc0fb9d update ipvs readme file 2017-11-09 13:40:45 +08:00
m1093782566 c7071ed09a try ipset in ipvs proxy mode 2017-11-07 17:34:27 +08:00
Kubernetes Submit Queue 830a363598
Merge pull request #51874 from vfreex/fix-ipvs-check
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>.

kube-proxy IPVS: Fix IPVS availability check

**What this PR does / why we need it**:
The current implementation of `CanUseIPVSProxier()` reads `/proc/modules`
to check whether IPVS related kernel modules can be loaded.
  
You might get a false-negative when the kernel modules are installed to
the system but haven't been loaded into the kernel.

This patch firstly try to run `modprobe` to load specified kernel
modules, then just log warnings if error occured.
Secondly, it will check loaded kernel modules by reading
`/proc/modules`, return an error if any required module is missing.

This change will not break the compatability of existing implementation.
Running kube-proxy in a container without mounting `/lib/modules` will
cause `modprobe` warnings, but not raise an error if all required modules are
present in the host kernel.

**Special notes for your reviewer**:

**Release note**:

```release-note
 Fix IPVS availability check
```
2017-11-03 09:04:25 -07:00
Kubernetes Submit Queue e19dbba8a2
Merge pull request #54972 from m1093782566/ipvs-ipv6
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>.

clean up legacy ipv4/32 in ipvs proxy

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

clean up legacy ipv4/32 in ipvs proxy

**Which issue(s) this PR fixes**: closes #51866

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
/sig network

/area ipv6

/assign @thockin 

cc @danehans
2017-11-02 21:52:38 -07:00
m1093782566 4ac7edb2a7 update readme in ipvs proxy 2017-11-02 12:19:03 +08:00
m1093782566 5075870150 clean up legacy ipv4/32 in ipvs proxy 2017-11-02 10:44:15 +08:00
Yuxiang Zhu 74a69d8e07 kube-proxy IPVS: Fix IPVS availability check
The current implementation of `CanUseIPVSProxier()` reads `/proc/modules`
to check whether IPVS related kernel modules can be loaded.

You might get a false-negative when the kernel modules are installed to
the system but haven't been loaded into the kernel.

This patch firstly try to run `modprobe` to load specified kernel
modules, then just log warnings if error occured.
Secondly, it will check loaded kernel modules by reading
`/proc/modules`, return an error if any required module is missing.

This change will not break the compatability of existing implementation.
Running kube-proxy in a container without mounting `/lib/modules` will
cause `modprobe` warnings, but not raise an error if all required modules are
present in the host kernel.
2017-11-01 17:37:12 +08:00
Kubernetes Submit Queue 53582702fc
Merge pull request #54774 from m1093782566/ipv6-bug
Automatic merge from submit-queue (batch tested with PRs 54774, 54820, 52192, 54827). 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 IPV6 judgement bug and add UTs

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

Fix IPV6 judgement bug and add UTs.

**Which issue this PR fixes** : closes #54775

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/sig network
/area ipv6
/kind bug
2017-10-31 13:22:15 -07:00
m1093782566 28000f925f fix IPV6 judgement bug and add UTs 2017-10-31 10:02:07 +08:00
Kubernetes Submit Queue ef2c3a526f
Merge pull request #54666 from m1093782566/fix-linux
Automatic merge from submit-queue (batch tested with PRs 53796, 54666, 54516, 54625, 54704). 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>.

Remove +linux restriction in ipvs/fake for running UTs in !linux platform

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

Remove +linux restriction in ipvs/fake for running UTs in !linux platform

**Which issue this PR fixes**: 

fixes #54667

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/sig network

/kind bug
2017-10-30 13:48:32 -07:00
m1093782566 bf2776eb3f update ipvs proxy readme 2017-10-28 11:41:56 +08:00