Commit Graph

699 Commits (56dc8f9a6ab09debeddf5349ee26730d3e9107f8)

Author SHA1 Message Date
Kubernetes Submit Queue 8fb3e3f5b0
Merge pull request #57942 from m1093782566/localhost-masq
Automatic merge from submit-queue (batch tested with PRs 58300, 58530, 57942, 58543). 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 nodeport localhost martian source error

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

kube-proxy NodePort access via localhost, with externalTrafficPolicy=Local will trigger martian source error.

This PR fixes nodeport localhost martian source error.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-19 20:00:36 -08:00
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
Kubernetes Submit Queue 550c0155fa
Merge pull request #58035 from m1093782566/windows-proxy-mode
Automatic merge from submit-queue (batch tested with PRs 58375, 58306, 58386, 57420, 58035). 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 windows UT for proxy mode

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

/kind bug

Fix windows UT for proxy mode.

Run UTs for `kubeproxyconfig/validation` in windows,

```
=== RUN   TestValidateKubeProxyConfiguration
--- FAIL: TestValidateKubeProxyConfiguration (0.00s)
        validation_test.go:83: expected success: [KubeProxyConfiguration.Mode.ProxyMode: Invalid value: "ipvs": must be kernelspace,userspace or blank (blank means the most-available proxy [currently userspace])]
```

That's because proxy mode "IPVS" is not valid in windows.


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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-17 13:08:37 -08:00
m1093782566 b015f1f567 add ut for localhost nodeport 2018-01-15 11:05:21 +08:00
m1093782566 60bde9fbe2 fix nodeport localhost martian source error 2018-01-15 11:05:18 +08:00
m1093782566 988c4ae6ba fix windows ut for proxy mode 2018-01-11 16:58:53 +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 46eabb7d91
Merge pull request #56534 from allenpetersen/updateGengo
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 gengo version to include goimports formatter

Update gengo which now uses goimports to format code and organize imports.

Fixes #55542

**Special notes for your reviewer**:
Updates version of k8s.io/gengo
Takes new dependency on golang.org/x/tools/imports and golang.org/x/tools/go/ast/astutil

**Release Notes**:
```release-note
NONE
```
2018-01-03 17:47:05 -08:00
Allen Petersen 3d69cea1e5 Update generated files 2018-01-02 22:13:19 -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
Kubernetes Submit Queue 637cd7d02a
Merge pull request #57679 from Lion-Wei/ipvs-4
Automatic merge from submit-queue (batch tested with PRs 57584, 57679). 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 the problem that kube-proxy can't create clusterIP ipvs rules when externalTrafficPolicy=Local

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-01-02 17:43:33 -08:00
Lion-Wei 93952fb39e create ipvs clusterIP rules in onlyNodeLocalEndpoints mode 2018-01-02 19:54:30 +08:00
Christoph Blecker 80e344644e
Regenerate all generated code 2018-01-02 00:21:07 -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
Kubernetes Submit Queue 6719e7ad9c
Merge pull request #56685 from m1093782566/fix-nodeport
Automatic merge from submit-queue (batch tested with PRs 54379, 56593, 56685, 54174, 57309). 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 proxier nodeport

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

Fix ipvs proxier nodeport.

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

**Special notes for your reviewer**:

We bump the netwlink version in the 1st commit because:

* We call `netlink.RouteListFiltered()` to filter LOCAL type addresses from kernel route table. `netlink.RouteListFiltered()` exists in newer-version netlink package


* newer-version netlink package migrate `syscall` to `golang.org/x/sys/unix`, k8s cross-build can benefit from it as well. 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.



**Release note**:

```release-note
Fix ipvs proxier nodeport eth* assumption
```
2017-12-18 14:45:42 -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
Kubernetes Submit Queue 1f025dde30
Merge pull request #57127 from feiskyer/proxy-validation
Automatic merge from submit-queue (batch tested with PRs 57127, 57011, 56754, 56601, 56483). 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>.

Enhance proxy mode validation

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

Proxy modes are list multiple times in validateProxyModeWindows and validateProxyModeLinux. This PR enhances the validation logic and only list them once.

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

Refer https://github.com/kubernetes/kubernetes/pull/56529/files#r156448205.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @thockin
2017-12-17 06:25:50 -08:00
Kubernetes Submit Queue e113c750cb
Merge pull request #56554 from m1093782566/win-test
Automatic merge from submit-queue (batch tested with PRs 56894, 56940, 55223, 56554, 54985). 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 in winkernel proxy UT

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

There is a `+build windows` tag in `pkg/proxy/winkernel/proxier_test.go`, it means the UTs will not run in upstream CI. Plus, the UT codes in  `pkg/proxy/winkernel/proxier_test.go` are not for winkernel proxier, instead they are for iptables proxier!

We should remove the dead code in winkernel proxy UT and then create the winkernel-specific UTs.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-16 13:50:00 -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 7bbb84caaa
Merge pull request #56368 from xiangpengzhao/validate-ipvs-stuff
Automatic merge from submit-queue (batch tested with PRs 57211, 56150, 56368, 56271, 55957). 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 IPVSConfiguration only when IPVS mode is enabled.

**What this PR does / why we need it**:
It's strange for users that they should configuration valid values for ipvs params even when they don't use ipvs mode. Users don't need to care about these params in this case.

**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 @m1093782566

**Release note**:

```release-note
NONE
```
2017-12-15 14:00:44 -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
Kubernetes Submit Queue bdd4820fed
Merge pull request #56578 from shift/feature/docs-typo
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>.

Fixed typo in IPVS documentation

**What this PR does / why we need it**:
Fixed documentation typo

**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
Fixed documentation typo in IPVS README.
```
2017-12-13 19:32:01 -08:00
Pengfei Ni f1e4181315 Enhance proxy mode validation 2017-12-13 13:29:21 +08:00
Zihong Zheng 9ab98d9f69 Remove ExternalTrafficLocalOnly from kube_feature gate 2017-12-07 21:25:11 -08:00
George Kudrayvtsev e48b6f3d15 Separates validation per-runtime. 2017-12-04 17:48:28 -08:00
George Kudrayvtsev 234ce8da41 Makes modes OS-specific (+ fixes tests). 2017-11-29 15:10:09 -08:00
Vincent Palmer 8961f69c7e Fixed typo 2017-11-29 16:01:26 +01:00
m1093782566 b5aab25fe1 update bazel BUILD 2017-11-29 15:30:16 +08:00
m1093782566 b9d01eb8ab remove winkernel dead test code 2017-11-29 15:27:44 +08:00
George Kudrayvtsev 54662ca7fa Updates Kube-proxy validators to allow Windows 'kernelspace' mode. 2017-11-28 18:04:51 -08:00
m1093782566 dc2e57ba74 refactor canUseIPVSMode and test it 2017-11-27 20:06:47 +08:00
xiangpengzhao d7c1100d1f Validate IPVSConfiguration only when IPVS mode is enable. 2017-11-25 16:05:15 +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