Commit Graph

978 Commits (c2b771d5c46ca3b2f58f72595fe07a4e56a63762)

Author SHA1 Message Date
liangwei a270d14a00 complete ipvs proxier test 2018-06-09 16:00:54 +08:00
Kubernetes Submit Queue 5aa8d690a1
Merge pull request #64554 from hanxiaoshuai/fix05312
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 bug excludeCIDRs was not assign in func NewProxier

**What this PR does / why we need it**:
fix bug excludeCIDRs was not assign in func NewProxier
**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
```
2018-06-09 00:01:29 -07:00
Guangya Liu 9cba55dac1 SupportIPVSProxyMode is true by default. 2018-06-07 19:44:11 +08:00
Lion-Wei c20bb4a7ee modify ipvs readme 2018-06-07 14:39:12 +08:00
Lion-Wei ec752d416c add Lion-Wei to ipvs reviewers list 2018-06-05 11:23:50 +08:00
Kubernetes Submit Queue 440b2b6ea7
Merge pull request #61077 from islinwb/fix_ipvs_warninfo
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>.

Init ipvsInterface only when ipvs modules are present

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-31 20:01:26 -07:00
hangaoshuai c3ee2802e4 fix bug excludeCIDRs was not assign in func NewProxier 2018-06-01 09:27:55 +08:00
hangaoshuai 9d944d30a6 remove unused parameter in func buildFakeProxier 2018-05-30 15:18:07 +08:00
Kubernetes Submit Queue 85f9108df1
Merge pull request #63964 from islinwb/update_ipvs_docs
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 docs --- check the prerequisite

**What this PR does / why we need it**:
As #63850 have been merged, the `Prerequisite` should be updated.

**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
```
2018-05-28 04:24:30 -07:00
Rene Treffer f66d4e183f Always masquerade node-originating traffic with a service VIP source ip 2018-05-24 09:42:48 +02:00
Kubernetes Submit Queue 094e605cd0
Merge pull request #64146 from Lion-Wei/ipvs-lb
Automatic merge from submit-queue (batch tested with PRs 64034, 64072, 64146, 64059, 64161). 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 session affinity for LoadBalancer service with ESIPP

**What this PR does / why we need it**:
fix session affinity for LoadBalancer service with ESIPP

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

**Special notes for your reviewer**:
In cases that loadbalancer type service with externaltrafficpolicy=local and session-affinity specified, traffic to loadbalancer should only route to backends that in the same node with kube-proxy. 

**Release note**:
```release-note
NONE
```
2018-05-22 19:20:18 -07:00
liangwei 62e3285cf8 ipvs lb local session affinity 2018-05-22 19:51:54 +08:00
Weibin Lin f86af07526 Update ipvs docs --- check the prerequisite 2018-05-18 09:46:10 +08:00
Weibin Lin ff8b70c409 Init ipvsInterface only when ipvs modules are present 2018-05-17 15:04:20 +08:00
Kubernetes Submit Queue 6406b9653d
Merge pull request #63850 from islinwb/check_ipvs_mod
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>.

Enable checking whether ipvs modules are built-in or not

**What this PR does / why we need it**:
Enable checking whether ipvs modules are built-in or not.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-16 03:33:20 -07:00
Weibin Lin c3e2fc0c0f Enable checking whether ipvs modules are built-in or not 2018-05-16 15:23:01 +08:00
Lion-Wei 339f92c175 abstract duplicated code in ipvs proxier 2018-05-16 11:53:15 +08:00
Weibin Lin 1558d13ca0
Add comments for ipset entries in kube-proxy - fix 2018-05-15 17:27:12 +08:00
Kubernetes Submit Queue fc28745535
Merge pull request #62003 from m1093782566/fix-nodeport
Automatic merge from submit-queue (batch tested with PRs 63787, 62003). 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 localport open with --nodeport-addresses specified

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

Fix localport open with --nodeport-addresses specified.

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

**Special notes for your reviewer**:

@ephur

**Release note**:

```release-note
Services can listen on same host ports on different interfaces with --nodeport-addresses specified
```
2018-05-14 12:21:12 -07:00
m1093782566 029a16a1eb fix review comments 2018-05-14 16:07:13 +08:00
Kubernetes Submit Queue e34df0a26c
Merge pull request #63585 from islinwb/ipset_comment
Automatic merge from submit-queue (batch tested with PRs 62833, 63585). 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 comments for ipset entries in kube-proxy

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-14 00:49:05 -07:00
Weibin Lin 10664ee8c6 Add comments for ipset entries in kube-proxy 2018-05-11 17:11:34 +08:00
Kubernetes Submit Queue 7eb88f11d2
Merge pull request #59727 from wgliang/master.time
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>.

should use time.Since instead of time.Now().Sub

**What this PR does / why we need it**:
should use time.Since instead of time.Now().Sub

**Special notes for your reviewer**:
2018-05-10 20:29:40 -07:00
Lion-Wei e90de22a5e fix ipvs fw 2018-05-07 11:22:34 +08:00
m1093782566 8b16d66b46 add some comment message 2018-05-02 17:02:07 +08:00
Kubernetes Submit Queue 03c5f298f3
Merge pull request #62534 from nicolasbigler/duplicate-iptables-comment
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 duplicate comment in iptables rule for non-local public-port rule

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

When kubernetes creates an iptable rule for "from-non-local public-port"
rule the rule gets created with two identical comment section.

The function `iptablesNonLocalNodePortArgs` creates a list of arguments
for the rule from iptablesCommonPortalArgs function. This function
already appends the arguments for the rules comments and therefore does
not require appending the comment again.

**Special notes for your reviewer**:

I'm actually not a go programmer at all and have no idea how your tests work.
I doubt that my fix will require adjustements on tests but I'm not 100% sure.
If additional work is needed, I would be glad if someone could point it out to me so I can take care of it.

**Release note**:
```release-note
NONE
```
2018-04-29 11:39:40 -07:00
Kubernetes Submit Queue 191d3c5681
Merge pull request #62718 from Lion-Wei/ipvs-host
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 problem that ipvs can't work with hostPort

**What this PR does / why we need it**:
Make ipvs proxy mode can work with pods that have hostPort.

**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 #61938
#60688 and #60305 are related too.

**Special notes for your reviewer**:
IPVS proxier will create dummy device named `kube-ipvs0`, which will maintain all ipvs virtual service address. That means all ipvs maintained clusterIP/externalIP/ingress will be treat as local address.

Then if we have a pod with hostPort, cni will attach this rule to `PREROUTING` chain:
```
KUBE-HOSTPORTS  all  --  0.0.0.0/0            0.0.0.0/0            /* kube hostport portals */ ADDRTYPE match dst-type LOCAL
```
so if a service have same port with pod's hostport, then this service can't be access.

In this pr, we added `ACCESS` rule for traffic that aim to ipvs virtual service, to prevent those traffic from be blocked by other rules.

**Release note**:
```release-note
NONE
```
2018-04-27 19:50:45 -07:00
Lion-Wei 76f6158b6c add accept for ipvs 2018-04-27 14:38:09 +08:00
Kubernetes Submit Queue 9a841b3efd
Merge pull request #63066 from Lion-Wei/ipvs-dummy
Automatic merge from submit-queue (batch tested with PRs 63129, 63066, 60009, 63136, 63086). 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>.

ipvs proxy bind externalIP and lb ingress.IP to dummy interface

**What this PR does / why we need it**:
IPVS proxy bind externalIP and lb ingress.IP to dummy interface.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-04-25 06:29:19 -07:00
Kubernetes Submit Queue c0d1ab8e99
Merge pull request #62083 from rramkumar1/ipvs-exclude-cidrs-flag
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 --ipvs-exclude-cidrs flag to kube-proxy. 

**What this PR does / why we need it**:
Add a flag to kube-proxy called --ipvs-exclude-cidrs. This flag allows a user to specify a list of CIDR ranges that should not be included in the cleanup of IPVS rules. 

Fixes: #59507

**Release note**:
```
Use --ipvs-exclude-cidrs to specify a list of CIDR's which the IPVS proxier should not touch when cleaning up IPVS rules.
```
/assign @m1093782566
2018-04-24 11:13:14 -07:00
Lion-Wei 1824053000 bind externalIP and lb IP 2018-04-24 15:40:20 +08:00
Lion-Wei 74e28b6402 fix ipvs delay on sync rules 2018-04-19 17:02:44 +08:00
Rohit Ramkumar 056ae4421c Add --ipvs-exclude-cidrs flag to kube-proxy. 2018-04-13 10:09:14 -07:00
Nicolas Bigler defdd80cbd
Fix duplicate comment in iptables rule for non-local public-port rule
When kubernetes creates an iptable rule for "from-non-local public-port"
rule the rule gets created with two identical comment section.

The function `iptablesNonLocalNodePortArgs` creates a list of arguments
for the rule from iptablesCommonPortalArgs function. This function
already appends the arguments for the rules comments and therefore does
not require appending the comment again.
2018-04-12 18:10:16 +02:00
m1093782566 00430b4b6c fix nodeport FORWARD chain 2018-04-12 17:25:28 +08:00
Wang Guoliang 89669283fe should use time.Since instead of time.Now().Sub 2018-04-10 12:05:51 +08:00
Kubernetes Submit Queue 9bd6c62a36
Merge pull request #61329 from Lion-Wei/ipvs-esipp
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 externaltrafficpolicy=local related ipvs ci case

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

**Special notes for your reviewer**:
To realize externalTrafficPolicy=local, but do not affect traffic inside the cluster.
If thie pr got merged, the iptables rules of ipvs proxy mode ESIPP should be like(for loadbalance case):
```
Chain KUBE-FIRE-WALL (1 references)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            match-set KUBE-LB-INGRESS-LOCAL dst,dst
KUBE-MARK-MASQ  all  --  0.0.0.0/0            0.0.0.0/0            /* mark MASQ for external traffic policy not local */

Chain KUBE-MARK-DROP (0 references)
target     prot opt source               destination         
MARK       all  --  0.0.0.0/0            0.0.0.0/0            MARK or 0x8000

Chain KUBE-MARK-MASQ (3 references)
target     prot opt source               destination         
MARK       all  --  0.0.0.0/0            0.0.0.0/0            MARK or 0x4000

Chain KUBE-NODE-PORT (1 references)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            match-set KUBE-NODE-PORT-LOCAL-TCP dst
KUBE-MARK-MASQ  all  --  0.0.0.0/0            0.0.0.0/0            /* mark MASQ for external traffic policy not local */

Chain KUBE-POSTROUTING (0 references)
target     prot opt source               destination         
MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0            /* kubernetes service traffic requiring SNAT */ mark match 0x4000/0x4000
MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0            match-set KUBE-LOOP-BACK dst,dst,src

Chain KUBE-SERVICES (2 references)
target     prot opt source               destination         
KUBE-MARK-MASQ  all  -- !10.64.0.0/14         0.0.0.0/0            match-set KUBE-CLUSTER-IP dst,dst
KUBE-FIRE-WALL  all  --  0.0.0.0/0            0.0.0.0/0            match-set KUBE-LOAD-BALANCER-MASQ dst,dst
KUBE-NODE-PORT  tcp  --  0.0.0.0/0            0.0.0.0/0            tcp match-set KUBE-NODE-PORT-TCP dst
```

**Release note**:
```release-note
NONE
```
2018-04-07 21:33:13 -07:00
Lion-Wei 076007b25d update build and s/where/which 2018-04-08 10:32:56 +08:00
Lion-Wei 2acd0abd8c add ut 2018-04-08 10:32:49 +08:00
Kubernetes Submit Queue b08ede9535
Merge pull request #61806 from hzxuzhonghu/LoadBalancerStatus-DeepCopy
Automatic merge from submit-queue (batch tested with PRs 61806, 61508, 62075, 62079, 62052). 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>.

make use of auto generated LoadBalancerStatus.DeepCopy

Remove LoadBalancerStatusDeepCopy in helpers.go, and use the auto generated `LoadBalancerStatus.DeepCopy` in pkg/apis/core/zz_generated.deepcopy.go.

**Release note**:

```release-note
NONE
```
2018-04-03 17:24:21 -07:00
m1093782566 ac1cd3dcb4 fix localport open - ipvs part changes 2018-04-02 11:53:37 +08:00
m1093782566 b2f5c8e610 fix localport open - iptables part changes 2018-04-02 11:53:12 +08:00
Guangya Liu 0dd857e008 Updated README for ipvs. 2018-04-01 22:28:43 +08:00
Lion-Wei 6762a865db fix ipvs esipp 2018-03-31 11:26:46 +08:00
hzxuzhonghu ab58014cc2 LoadBalancerStatus make use of generated deep copy method 2018-03-28 14:08:50 +08:00
Lion-Wei c8fae0ee4d add lb source test 2018-03-27 11:31:37 +08:00
Lion-Wei dce97b165e ipvs loadbalance 2018-03-27 10:44:26 +08:00
Kubernetes Submit Queue 1e32a4ad79
Merge pull request #59720 from islinwb/ipvs_doc
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 doc

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-22 19:33:01 -07:00
Kubernetes Submit Queue e40ffd7197
Merge pull request #59172 from fisherxu/removeyear
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 YEAR field of all generated files and fix kubernetes boilerplate checker

**What this PR does / why we need it**:
Remove YEAR field of all generated files and fix kubernetes boilerplate checker
xref: [remove YEAR fileds in gengo #91](https://github.com/kubernetes/gengo/pull/91)

**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 [#gengo/issues/24](https://github.com/kubernetes/gengo/issues/24)

**Special notes for your reviewer**:
/cc @thockin @lavalamp @sttts 

**Release note**:

```release-note
NONE
```
2018-03-21 12:44:37 -07:00
hzxuzhonghu 74121c70d6 update bazel 2018-03-09 09:23:33 +08:00
hzxuzhonghu 2b7fd92dce userspace: move udp echo server to proxier_test.go 2018-03-09 09:22:30 +08:00
fisherxu b49ef6531c regenerated all files and remove all YEAR fields 2018-03-08 17:52:48 +08:00
Weibin Lin 71c26f0d73 Update IPVS doc 2018-03-01 11:37:29 +08:00
Kubernetes Submit Queue f45f4a4ec0
Merge pull request #56880 from MrHohn/kube-proxy-ipv6-fix
Automatic merge from submit-queue (batch tested with PRs 53689, 56880, 55856, 59289, 60249). 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>.

Harden kube-proxy for unmatched IP versions

**What this PR does / why we need it**:
This PR makes kube-proxy omits & logs & emits event for unmatched IP versions configuration (IPv6 address in IPv4 mode or IPv4 address in IPv6 mode). 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix the issue in kube-proxy iptables/ipvs mode to properly handle incorrect IP version.
```
2018-02-28 00:00:29 -08:00
Kubernetes Submit Queue 24516c5a96
Merge pull request #60501 from johscheuer/fix-ipvs-kubeadm-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>.

Remove old featureGate flag in Readme

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

This PR corrects the Readme for ipvs mode: https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/ipvs/README.md. `kubeadm init` doesn't support the `--feature-gates=SupportIPVSProxyMode=true` flag anymore since IPVS is in beta and not alpha anymore.


```
sudo kubeadm init --help
Run this command in order to set up the Kubernetes master.

Usage:
  kubeadm init [flags]

Flags:
      --apiserver-advertise-address string      The IP address the API Server will advertise it's listening on. Specify '0.0.0.0' to use the address of the default network interface.
      --apiserver-bind-port int32               Port for the API Server to bind to. (default 6443)
      --apiserver-cert-extra-sans stringSlice   Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.
      --cert-dir string                         The path where to save and store the certificates. (default "/etc/kubernetes/pki")
      --config string                           Path to kubeadm config file. WARNING: Usage of a configuration file is experimental.
      --cri-socket string                       Specify the CRI socket to connect to. (default "/var/run/dockershim.sock")
      --dry-run                                 Don't apply any changes; just output what would be done.
      --feature-gates string                    A set of key=value pairs that describe feature gates for various features. Options are:
CoreDNS=true|false (ALPHA - default=false)
DynamicKubeletConfig=true|false (ALPHA - default=false)
SelfHosting=true|false (ALPHA - default=false)
StoreCertsInSecrets=true|false (ALPHA - default=false)
      --ignore-preflight-errors stringSlice     A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.
      --kubernetes-version string               Choose a specific Kubernetes version for the control plane. (default "stable-1.9")
      --node-name string                        Specify the node name.
      --pod-network-cidr string                 Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.
      --service-cidr string                     Use alternative range of IP address for service VIPs. (default "10.96.0.0/12")
      --service-dns-domain string               Use alternative domain for services, e.g. "myorg.internal". (default "cluster.local")
      --skip-token-print                        Skip printing of the default bootstrap token generated by 'kubeadm init'.
      --token string                            The token to use for establishing bidirectional trust between nodes and masters.
      --token-ttl duration                      The duration before the bootstrap token is automatically deleted. If set to '0', the token will never expire. (default 24h0m0s)
```

**Special notes for your reviewer**:
Used kubeadm version:

```bash
sudo kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"d2835416544f298c919e2ead3be3d0864b52323b", GitTreeState:"clean", BuildDate:"2018-02-07T11:55:20Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
```

**Release note**:

```release-note
NONE
```
2018-02-27 21:40:36 -08:00
Zihong Zheng 6004452bed Auto-updated BUILD files 2018-02-27 11:18:11 -08:00
Zihong Zheng f6eed81f21 [kube-proxy] Mass service/endpoint info functions rename and comments 2018-02-27 11:14:02 -08:00
Zihong Zheng 06064498de [kube-proxy] Unit test for unmatched IP version 2018-02-27 11:14:02 -08:00
Zihong Zheng 95cde4fb98 [kube-proxy] Harden change tracker and proxiers for unmatched IP versions 2018-02-27 11:14:02 -08:00
Zihong Zheng 2ae45e9f1b [kube-proxy] Make the import name of utilproxy consistent 2018-02-27 11:14:02 -08:00
Zihong Zheng ca032528be [kube-proxy] Add more IP version related utils 2018-02-27 11:14:02 -08:00
Zihong Zheng dfbec1a63a [kube-proxy] Move ipv6 related funcs to utils pkg 2018-02-27 11:12:45 -08:00
Zihong Zheng b485f7b5b4 [kube-proxy] Move Service/EndpointInfo common codes to change tracker 2018-02-27 11:05:59 -08:00
Kubernetes Submit Queue 42378eab40
Merge pull request #58052 from m1093782566/nodeip-config
Automatic merge from submit-queue (batch tested with PRs 60430, 60115, 58052, 60355, 60116). 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>.

Make nodeport ip configurable

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

By default, kube-proxy accepts everything from NodePort without any filter. It can be a problem for nodes which has both public and private NICs, and people only want to provide a service in private network and avoid exposing any internal service on the public IPs.

This PR makes nodeport ip configurable.

**Which issue(s) this PR fixes**:
Closes: #21070

**Special notes for your reviewer**:

Design proposal see: https://github.com/kubernetes/community/pull/1547

Issue in feature repo: https://github.com/kubernetes/features/issues/539

**Release note**:

```release-note
Make NodePort IP addresses configurable
```
2018-02-27 09:38:44 -08:00
Johannes Scheuermann 7bf7f9c79c Remove old featureGate flag 2018-02-27 14:01:45 +01:00
jennybuckley c8dacd8e63 Run hack/update-all.sh 2018-02-26 17:16:14 -08:00
Kubernetes Submit Queue 05425f0826
Merge pull request #60256 from danwinship/review-iptables-stuff
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 me to iptables/kube-proxy reviewers

kube-proxy needs reviewers!
2018-02-26 07:50:58 -08:00
m1093782566 2edc97bf17 fix static checks 2018-02-26 23:49:26 +08:00
m1093782566 9bb4807e25 update bazel 2018-02-26 23:48:48 +08:00
m1093782566 df7df811a4 auto generated codes 2018-02-26 23:48:48 +08:00
m1093782566 b498a33927 userspace part changes 2018-02-26 23:48:48 +08:00
m1093782566 c537ff54e7 ipvs part implementation 2018-02-26 23:48:47 +08:00
m1093782566 ddfa04e8f4 iptables part implementation 2018-02-26 23:48:47 +08:00
m1093782566 bf565305ee create netwowrk interface util 2018-02-26 23:48:46 +08:00
m1093782566 dbcb2c9b27 validate nodeport-addresses 2018-02-26 23:48:46 +08:00
m1093782566 bc850adce4 add nodeport-addresses flag for kube-proxy 2018-02-26 23:48:46 +08:00
Kubernetes Submit Queue c11ae9d21e
Merge pull request #60306 from danwinship/proxier-connstate-new
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>.

Only run connection-rejecting rules on new connections

Kube-proxy has two iptables chains full of rules to reject incoming connections to services that don't have any endpoints. Currently these rules get tested against all incoming packets, but that's unnecessary; if a connection to a given service has already been established, then we can't have been rejecting connections to that service. By only checking the first packet in each new connection, we can get rid of a lot of unnecessary checks on incoming traffic.

Fixes #56842

**Release note**:
```release-note
Additional changes to iptables kube-proxy backend to improve performance on clusters with very large numbers of services.
```
2018-02-24 16:19:56 -08:00
Kubernetes Submit Queue c1a73ea685
Merge pull request #59286 from prameshj/udp-conntrack
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>.

Delete stale UDP conntrack entries that use hostPort

**What this PR does / why we need it**:
This PR introduces a change to delete stale conntrack entries for UDP connections, specifically for udp connections that use hostPort. When the pod listening on that udp port get updated/restarted(and gets a new ip address), these entries need to be flushed so that ongoing udp connections can recover once the pod is back and the new iptables rules have been installed. 
**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 #59033

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-23 19:54:08 -08:00
Kubernetes Submit Queue e6c2a5de10
Merge pull request #57461 from danwinship/proxier-no-dummy-nat-rules
Automatic merge from submit-queue (batch tested with PRs 55637, 57461, 60268, 60290, 60210). 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>.

Don't create no-op iptables rules for services with no endpoints

Currently for all services we create `-t nat -A KUBE-SERVICES` rules that match the destination IPs (ClusterIP, ExternalIP, NodePort IPs, etc) and then jump to the appropriate `KUBE-SVC-XXXXXX` chain. But if the service has no endpoints then the `KUBE-SVC-XXXXXX` chain will be empty and so nothing happens except that we wasted time (a) forcing iptables-restore to parse the match rules, and (b) forcing the kernel to test matches that aren't going to have any effect.

This PR gets rid of the match rules in this case. Which is to say, it changes things so that every incoming service packet is matched *either* by nat rules to rewrite it *or* by filter rules to ICMP reject it, but not both. (Actually, that's not quite true: there are no filter rules to reject Ingress-addressed packets, and I *think* that's a bug?)

I also got rid of some comments that seemed redundant.

The patch is mostly reindentation, so best viewed with `diff -w`.

Partial fix for #56842 / Related to #56164 (which it conflicts with but I'll fix that after one or the other merges).

**Release note**:
```release-note
Removed some redundant rules created by the iptables proxier, to improve performance on systems with very many services.
```
2018-02-23 09:49:38 -08:00
Dan Winship 225941679e Only run connection-rejecting rules on new connections 2018-02-23 08:50:58 -05:00
Kubernetes Submit Queue be2880d6be
Merge pull request #57550 from m1093782566/cleanup-mode
Automatic merge from submit-queue (batch tested with PRs 57550, 60089). 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 inconsistent comment message

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

remove dead code in `/pkg/proxy/apis/kubeproxyconfig/validation/validation.go` - see duplicated codes in https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/apis/kubeproxyconfig/types.go#L155-L169

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-23 04:01:33 -08:00
Pavithra Ramesh 098a4467fe Remove conntrack entry on udp rule add.
Moved conntrack util outside of proxy pkg
Added warning message if conntrack binary is not found
Addressed review comments.
ran gofmt
2018-02-22 23:34:42 -08:00
m1093782566 181930794c fix proxy mode comment message 2018-02-23 11:50:42 +08:00
m1093782566 c44399f31e fix proxy mode comment message in v1alpha1 2018-02-23 11:50:39 +08:00
Kubernetes Submit Queue da564ef4fb
Merge pull request #57962 from xiangpengzhao/proxy-feature-gates
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>.

 Migrate FeatureGates type of kube-proxy from string to map[string]bool

**What this PR does / why we need it**:
Migration of FeatureGates type. This is a follow-up of #53025.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: #53025
https://github.com/kubernetes/kubernetes/pull/57754#discussion_r160023416

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

**Release note**:

```release-note
action required: kube-proxy: feature gates are now specified as a map when provided via a JSON or YAML KubeProxyConfiguration, rather than as a string of key-value pairs.
```
2018-02-22 19:32:41 -08:00
Kubernetes Submit Queue f0ca996274
Merge pull request #56164 from danwinship/proxier-chain-split
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>.

Split KUBE-SERVICES chain to re-shrink the INPUT chain

**What this PR does / why we need it**:
#43972 added an iptables rule "`-A INPUT -j KUBE-SERVICES`" to make NodePort ICMP rejection work. (Previously the KUBE-SERVICES chain was only run from OUTPUT, not INPUT.) #44547 extended that patch for ExternalIP rejection as well.

However, the KUBE-SERVICES chain may potentially have a very large number of ICMP reject rules for plain ClusterIP services (the ones that get run from OUTPUT), and it seems that for some reason the kernel is much more sensitive to the length of the INPUT chain than it is to the length of the OUTPUT chain. So a node that worked fine with kube 1.6 (when KUBE-SERVICES was only run from OUTPUT) might fall over with kube 1.7 (with KUBE-SERVICES being run from both INPUT and OUTPUT).

(Specifically, a node with about 5000 ClusterIP reject rules that ran fine with OpenShift 3.6 [kube 1.6] slowed almost to a complete halt with OpenShift 3.7 [kube 1.7].)

This PR fixes things by splitting out the "new" part of KUBE-SERVICES (NodePort and ExternalIP reject rules) into a separate KUBE-EXTERNAL-SERVICES chain run from INPUT, and moves KUBE-SERVICES back to being only run from OUTPUT. (So, yes, this assumes that you don't have 5000 NodePort/ExternalIP services, but, if you do, there's not much we can do, since those rules *have* to be run on the INPUT side.)

Oh, and I left in the code to clean up the "`-A INPUT -j KUBE-SERVICES`" rule even though we don't generate it any more, so it gets fixed on upgrade.

**Release note**:
```release-note
Reorganized iptables rules to fix a performance regression on clusters with thousands of services.
```

@kubernetes/sig-network-bugs @kubernetes/rh-networking
2018-02-22 18:52:53 -08:00
Dan Winship fc03cfe7a8 add me to iptables/kube-proxy reviewers 2018-02-22 17:36:57 -05:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Davanum Srinivas 692f2ec305 Standardize on KUBE_PROXY_MODE (not KUBEPROXY_MODE)
There's a disconnect between 12d4eac038
and the earlier a6af827898. One says
KUBEPROXY_MODE and another says KUBE_PROXY_MODE. Let's just pick one.
Currently we fail with the following error:

hack/local-up-cluster.sh: line 808: KUBEPROXY_MODE: unbound variable
2018-02-14 21:26:54 -05:00
Dan Winship 07ead7d8e2 Don't create no-op iptables rules for services with no endpoints 2018-02-13 07:52:47 -05:00
Lihua Tang cad52f6576 Fix typos 2018-02-13 16:17:37 +08:00
Kubernetes Submit Queue 9438e14d39
Merge pull request #52528 from m1093782566/refactor-proxy
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>.

Refactor kube-proxy service/endpoints update so that can be consumed among different proxiers

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

There are huge duplication among different proxiers.  For example, the service/endpoints list/watch part in iptables, ipvs and windows kernel mode(to be get in soon).

I think the more places this is replicated the harder it becomes to keep correct. We may need to refactor it and let different proxiers consume the same code.

**Which issue this PR fixes**: 

fixes #52464

**Special notes for your reviewer**:

* This refactor reduces **500** Lines in iptables proxy, so it will reduce **500*N**(number of proxiers) lines in total. People no need to care the service/endpoints update logic any more and can be more focus on proxy logic.

* I would like to do the following things in follow-ups:

1. rsync it to ipvs proxier

2. rsync it to winkernel proxier

**Release note**:

```release-note
Refactor kube-proxy service/endpoints update so that can be consumed among different proxiers
```
2018-02-12 23:29:50 -08:00
xiangpengzhao 131ce79c65 Update fuzzer to reflect FeatureGates type change. 2018-02-11 15:15:22 +08:00
xiangpengzhao 58bb1447e9 Auto generated files. 2018-02-11 14:40:13 +08:00
xiangpengzhao 57071d85ee Migrate FeatureGates type of kube-proxy from string to map[string]bool 2018-02-11 14:40:13 +08:00
Kubernetes Submit Queue 317853c90c
Merge pull request #59464 from dixudx/fix_all_typos
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 all the typos across the project

**What this PR does / why we need it**:
There are lots of typos across the project. We should avoid small PRs on fixing those annoying typos, which is time-consuming and low efficient.

This PR does fix all the typos across the project currently. And with #59463, typos could be avoided when a new PR gets merged.

**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**:
/sig testing
/area test-infra
/sig release
/cc @ixdy 
/assign @fejta 

**Release note**:

```release-note
None
```
2018-02-10 22:12:45 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
stewart-yu 2e67243497 fix deleting dummy device error in kube-proxy.log when run cluster in local 2018-02-11 10:59:09 +08:00
m1093782566 b7dbaab96a update bazel BUILD 2018-02-09 17:26:22 +08:00
m1093782566 8dd4cbe88b ipvs part changes 2018-02-09 17:20:55 +08:00
m1093782566 f3512cbbb9 iptables proxier part changes 2018-02-09 17:20:51 +08:00
m1093782566 6edcf02d9e proxy endpoints part changes 2018-02-09 17:20:47 +08:00
m1093782566 9e85b526cb proxy service part changes 2018-02-09 17:20:44 +08:00
Dan Winship 780d5954e0 Split out a KUBE-EXTERNAL-SERVICES chain so we don't have to run KUBE-SERVICES from INPUT 2018-02-07 10:20:52 -05:00
m1093782566 2ee1c80d0f abstract proxy servicePort and endpoints 2018-02-07 11:46:31 +08:00
Kubernetes Submit Queue 283d35a481
Merge pull request #57336 from danwinship/proxier-simplification
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>.

Abstract some duplicated code in the iptables proxier

Reorganizes the iptables proxier code so we only have the list of "-A FOO -j KUBE-BAR" rules in one place rather than duplicating the same list in multiple places. Split out from #56164 for ease of review/merging.

**Release note**:
```release-note
NONE
```
2018-02-06 15:54:07 -08:00
Kubernetes Submit Queue ebffd76acf
Merge pull request #57268 from m1093782566/validate-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>.

validate ipset set and entry - ipvs proxier validate entry before adding it and validate set before creating it

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

validate ipset util.

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

**Special notes for your reviewer**:

I splitted this PR into some small pieces for the sake of code review.

**Release note**:

```release-note
NONE
```
2018-02-06 14:35:34 -08:00
Kubernetes Submit Queue 228b7d5d53
Merge pull request #55986 from xiangpengzhao/kubeproxy-fuzzer
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 kubeproxyconfig round trip test

**What this PR does / why we need it**:
This is a follow-up of https://github.com/kubernetes/kubernetes/pull/55961.

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

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

**Release note**:

```release-note
NONE
```
2018-02-05 20:23:02 -08:00
Kubernetes Submit Queue ab83d374df
Merge pull request #57754 from ncdc/fix-kube-proxy-config-docs-and-json-tags
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: fix field name comments & json tags

**What this PR does / why we need it**: correct some minor issues in the comments and json tags for some of the fields in the kube-proxy config structs.

**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
The udpTimeoutMilliseconds field in the kube-proxy configuration file has been renamed to udpIdleTimeout. Action required: administrators need to update their files accordingly.
```

This was extracted from my currently unmerged f074b28fe9, as requested [here](https://github.com/kubernetes/kubernetes/pull/52198#pullrequestreview-85538637).

@kubernetes/sig-network-pr-reviews @luxas
2018-02-05 19:43:42 -08:00
m1093782566 10a899f31e clean up code 2018-02-06 10:17:02 +08:00
Kubernetes Submit Queue 853076a908
Merge pull request #59248 from m1093782566/ipvs-owners
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>.

Initialize IPVS proxy OWNERS file

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

Initialize IPVS proxy OWNERS file. There are 3 initial members: @thockin, @brendandburns and me :)

@thockin and @brendandburns has reviewed most of the IPVS proxier PRs.

I initialized this package and authored most of the commits.

**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
```
2018-02-05 10:05:53 -08:00
Kubernetes Submit Queue 6c23b920b7
Merge pull request #55606 from Lion-Wei/proxier-1
Automatic merge from submit-queue (batch tested with PRs 55606, 59185, 58763, 59072, 59251). 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>.

make ipvs 'cleanupIptablesLeftovers' simplier

Since there are only four iptables chains in ipvs mode, no need to restore all chains when cleanup iptables chain created by ipvs.

**What this PR does / why we need it**:
Make ipvs `cleanupIptablesLeftovers` function much simplier.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-02-02 18:26:32 -08:00
m1093782566 e132ea98a0 initialize ipvs proxy owners file 2018-02-02 15:12:24 +08:00
m1093782566 460573d411 update bazel 2018-02-02 14:41:45 +08:00
m1093782566 5c3ee0f2fa check ErrorNotFound in netlink.go to fix cross build error 2018-02-02 14:28:55 +08:00
m1093782566 477b0f0636 fix review comments 2018-02-02 10:08:43 +08:00
m1093782566 4df6662d56 validate ipset entry before adding in ipvs proxier 2018-02-02 10:08:43 +08:00
m1093782566 e768924a62 validate entry in ipset 2018-02-02 10:08:43 +08:00
m1093782566 9e9e264964 refactor ipset interface AddEntry() 2018-02-02 10:08:43 +08:00
Kubernetes Submit Queue ba43ffa9b8
Merge pull request #58680 from m1093782566/ipvs-del-service
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>.

Ignore address not exist error when unbind IPVS serivce address from dummy device

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

Ignore address not exist error when unbind IPVS serivce address from dummy device.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-01 11:23:31 -08:00
Kubernetes Submit Queue 3d786f27a6
Merge pull request #53778 from Mashimiao/more-ipv6-userspace
Automatic merge from submit-queue (batch tested with PRs 53778, 58378, 58830). 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 more ipv6 support in userspace proxier

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


**What this PR does / why we need it**:
format `%s:%d/%s"` is not suitable for ipv6 IP, replace with net.JoinHostPort

**Release note**:
```release-note
None
```
2018-01-25 17:09:32 -08:00
m1093782566 c1ba9b453d update bazel BUILD 2018-01-23 19:06:29 +08:00
m1093782566 a073a058dc ignore no such address error when unbind ip for IPVS service 2018-01-23 19:06:29 +08:00
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
xiangpengzhao efeb7641e4 Auto generated BUILD files 2018-01-04 10:31:52 +08:00
xiangpengzhao 14d01883ed Add kubeproxyconfig round trip test 2018-01-04 10:31:44 +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
Andy Goldstein fa3fb91a76 kube-proxy: fix field name comments & json tags
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-01-02 10:20:43 -05: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
Lion-Wei e661a23d16 fix todo in 'ipvs/proxier.go' 2017-12-20 10:02:32 +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
Dan Winship 25e5c40acb Abstract some duplicated code in the iptables proxier 2017-12-18 10:18:54 -05: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
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 02ca5cac01
Merge pull request #53555 from leblancd/v6_del_endpoint_proxier
Automatic merge from submit-queue (batch tested with PRs 55988, 53555, 55858). 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 IPv6 and negative UT test cases for proxier's deleteEndpointConnections

This change adds IPv6 and negative UT test cases for the proxier's deleteEndpointConnections.

Changes include:
- Add IPv6 UT test cases to TestDeleteEndpointConnections.
- Add negative UT test case to TestDeleteEndpointConnections for
  handling case where no connections need clearing (benign error).
- Add negative UT test case to test unexpected error.
- Reorganize UT in TestDeleteEndpointConnections so that the fake
  command executor's command and scripted responses are generated on
  the fly based on the test case table (rather than using a fixed
  set of commands/responses that will need to be updated every time
  test cases are added/deleted).
- Create the proxier service map in real time, based on the test case
  table (rather than using a fixed service map that will need to be updated
  every time test cases are added/deleted).

fixes #53554



**What this PR does / why we need it**:
This change adds IPv6 and negative UT test cases for the proxier's
deleteEndpointConnections.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-18 20:31:23 -08:00
Kubernetes Submit Queue c00500ee31
Merge pull request #55817 from danehans/issue_55816
Automatic merge from submit-queue (batch tested with PRs 55757, 55741, 55817, 55834, 51530). 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>.

Fixes Issue 55816: Removes unneeded IPPart error

**What this PR does / why we need it**:
Previously proxy was incorrectly logging an error message for the IPPart function. The PR fixes this logging behavior to only log `invalid IP part` for invalid IP:Port combinations.

**Which issue(s) this PR fixes**:
Fixes # https://github.com/kubernetes/kubernetes/issues/55816

**Special notes for your reviewer**:
None

**Release note**:
```
none
```
2017-11-18 16:38:30 -08:00
Kubernetes Submit Queue 9a812b17a7
Merge pull request #55757 from yanxuean/remove-schema
Automatic merge from submit-queue (batch tested with PRs 55757, 55741, 55817, 55834, 51530). 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 AddToGroupVersion in kubeproxy scheme

ref https://github.com/kubernetes/kubernetes/pull/53645#discussion_r148850279
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>

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

**Release note**:

```release-note
NONE
```
/assign @ncdc
2017-11-18 16:38:25 -08:00
Daneyon Hansen 8deec6a7db Fixes Issue 55816: Removes unneeded IPPart error 2017-11-15 13:28:17 -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
yanxuean 77d967675e update bazel
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-11-15 11:28:23 +08:00
yanxuean 8b43647c74 remove AddToGroupVersion in kubeproxy scheme
ref #53645
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-11-15 10:58:17 +08:00
Kubernetes Submit Queue 2f622b2a28
Merge pull request #52569 from tmjd/add-proxy-forward-rules
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>.

Kube-proxy adds forward rules to ensure NodePorts work

**What this PR does / why we need it**:
Updates kube-proxy to set up proper forwarding so that NodePorts work with docker 1.13 without depending on iptables FORWARD being changed manually/externally.

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

**Special notes for your reviewer**:
@thockin I used option number 2 that I mentioned in the #39823 issue, please let me know what you think about this change.  If you are happy with the change then I can try to add tests but may need a little direction about what and where to add them.

**Release note**:

```release-note
Add iptables rules to allow Pod traffic even when default iptables policy is to reject.
```
2017-11-14 00:09:57 -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
Doug MacEachern 7950609b31 Enforce use of fixed size int types in the API
Changes 'int' to 'int32', enforced by import_known_versions_test

Follow up to PR #53402
2017-11-13 11:28:59 -08:00
m1093782566 42832e7666 fix ipvs proxier getLocalIPs() error 2017-11-13 17:55:53 +08:00
Ma Shimiao 9cfdc8fbde add more ipv6 support in userspace proxier
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-11-13 17:00:52 +08:00
Kubernetes Submit Queue d6cabaf706
Merge pull request #55568 from m1093782566/unsortlist
Automatic merge from submit-queue (batch tested with PRs 53580, 55568). 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 sets.List() with sets.UnsortedList() in pkg/proxy

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

Replace sets.List() with sets.UnsortedList() in pkg/proxy - sets.List() will sort the result array, we don't need sorted array in pkg/proxy. Using sets.UnsortedList() can reduce the unnecessary overhead spending.

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

@wojtek-t wdyt ^_^

**Release note**:

```release-note
NONE
```

/sig network
2017-11-12 21:07:37 -08:00
m1093782566 83ada5c7bf replace sets.List() with sets.UnsortedList() 2017-11-13 10:20:54 +08:00
Zihong Zheng f7ed9cf09a [kube-proxy] Fix session affinity with local endpoints traffic 2017-11-10 18:42:07 -08:00
Dr. Stefan Schimanski 1e79dfb959 Update generated code 2017-11-10 18:26:46 +01:00
Dr. Stefan Schimanski 72809a08b9 deepcopy: remove deepcopy register tags 2017-11-10 18:25:26 +01: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