Commit Graph

1797 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
d86c013b0d
Merge pull request #108250 from cyclinder/add_flag_in_proxy
kube-proxy:  add a flag  to  disable nodePortOnLocalhost
2022-11-03 17:10:13 -07:00
Andy Voltz
29f4862ed8 Promote ServiceInternalTrafficPolicy to GA 2022-11-03 13:17:03 -04:00
Kubernetes Prow Robot
86a6ace994
Merge pull request #113277 from manav014/master
Cleanup: kube-proxy internal naming
2022-11-02 18:21:05 -07:00
Kubernetes Prow Robot
b60b0c74c9
Merge pull request #113521 from daschott/user/daschott/winkernel-stale-vips
resolve winkernel proxier treating stale VIPs as valid
2022-11-02 16:29:24 -07:00
Manav Agarwal
3320e50e24 If applied, this commit will refactor variable names in kube-proxy 2022-11-03 03:45:57 +05:30
cyclinder
bef2070031
kube-proxy: add a flag to disables the allowing NodePort services to be accessed via localhost 2022-11-02 16:17:52 +08:00
Kubernetes Prow Robot
3edbebe348
Merge pull request #110268 from danwinship/minimize-iptables-changes
minimize iptables-restore input
2022-11-01 18:06:46 -07:00
daschott
7b6e4e4d8b added retries to winkernel proxy rules deletion 2022-11-01 16:42:07 -07:00
daschott
dc2fc1045d added backend hashing to winkernel proxier 2022-10-31 21:57:34 -07:00
Kubernetes Prow Robot
4c657e5014
Merge pull request #110403 from claudiubelu/unittests-3
unittests: Fixes unit tests for Windows (part 3)
2022-10-31 15:52:44 -07:00
Claudiu Belu
9f95b7b18c unittests: Fixes unit tests for Windows (part 3)
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- paths not properly joined (filepath.Join should be used).
- Proxy Mode IPVS not supported on Windows.
- DeadlineExceeded can occur when trying to read data from an UDP
  socket. This can be used to detect whether the port was closed or not.
- In Windows, with long file name support enabled, file names can have
  up to 32,767 characters. In this case, the error
  windows.ERROR_FILENAME_EXCED_RANGE will be encountered instead.
- files not closed, which means that they cannot be removed / renamed.
- time.Now() is not as precise on Windows, which means that 2
  consecutive calls may return the same timestamp.
- path.Base() will return the same path. filepath.Base() should be used
  instead.
- path.Join() will always join the paths with a / instead of the OS
  specific separator. filepath.Join() should be used instead.
2022-10-21 19:25:48 +03:00
Han Kang
958845e0be migrate usage of to for static analysis
Change-Id: I33753683b48a8a57b2548b0d3caeb6050ddc5c95
2022-10-18 17:01:32 -07:00
Antonio Ojea
a38b9363ec kube-proxy handle node PodCIDR changs
Kube/proxy, in NodeCIDR local detector mode, uses the node.Spec.PodCIDRs
field to build the Services iptables rules.

The Node object depends on the kubelet, but if kube-proxy runs as a
static pods or as a standalone binary, it is not possible to guarantee
that the values obtained at bootsrap are valid, causing traffic outages.

Kube-proxy has to react on node changes to avoid this problems, it
simply restarts if detect that the node PodCIDRs have changed.

In case that the Node has been deleted, kube-proxy will only log an
error and keep working, since it may break graceful shutdowns of the
node.
2022-10-18 19:25:40 +00:00
Antonio Ojea
cf532a8e36 kube-proxy: gate topology correctly 2022-10-18 19:25:40 +00:00
Claudiu Belu
af77381e01 unit tests: Skip Windows-unrelated tests on Windows
Some of the unit tests cannot pass on Windows due to various reasons:

- fsnotify does not have a Windows implementation.
- Proxy Mode IPVS not supported on Windows.
- Seccomp not supported on Windows.
- VolumeMode=Block is not supported on Windows.
- iSCSI volumes are mounted differently on Windows, and iscsiadm is a
  Linux utility.
2022-10-18 12:43:07 +03:00
daschott
fba80c8b89 added daschott to winkernel owners 2022-10-17 16:28:11 -07:00
Amim Knabben
c0d323f1f6 Fixing words in the comment 2022-10-15 15:54:41 -03:00
Kubernetes Prow Robot
6705015101
Merge pull request #112133 from knabben/remove-kproxy-userspace
Remove kube-proxy userspace modes
2022-10-14 17:31:06 -07:00
DingShujie
e1f0b85334 Dismiss connects to localhost early in the service chain
Signed-off-by: DingShujie <dingshujie@huawei.com>
2022-10-11 13:57:35 +08:00
Amim Knabben
7df6c02288 Remove Linux and Windows Kube-proxy Userspace mode 2022-10-05 16:59:02 -03:00
daschott
5bbf421841 Fix winkernel proxier setting the wrong HNS loadbalancer ID for ingress IP 2022-10-03 13:23:56 -07:00
Dan Winship
818de5a545 proxy/iptables: Add metric for partial sync failures, add test 2022-09-26 16:31:42 -04:00
Dan Winship
ab326d2f4e proxy/iptables: Don't rewrite chains that haven't changed
iptables-restore requires that if you change any rule in a chain, you
have to rewrite the entire chain. But if you avoid mentioning a chain
at all, it will leave it untouched. Take advantage of this by not
rewriting the SVC, SVL, EXT, FW, and SEP chains for services that have
not changed since the last sync, which should drastically cut down on
the size of each iptables-restore in large clusters.
2022-09-26 16:30:42 -04:00
Quan Tian
8a73e79777 Fix outdated code comments of proxierHealthServer
Signed-off-by: Quan Tian <qtian@vmware.com>
2022-09-21 23:21:19 +08:00
Kubernetes Prow Robot
e8e20ce563
Merge pull request #112451 from aojea/proxy_logging
kube-proxy use debug log level for Service cache operations
2022-09-19 14:21:45 -07:00
Kubernetes Prow Robot
918f84cd90
Merge pull request #112463 from Nordix/fix-ipvs-filter
Corrects target in the KUBE-IPVS-FILTER chain
2022-09-15 02:45:22 -07:00
Lars Ekman
639b9bca5d Corrects target in the KUBE-IPVS-FILTER chain
The target was "ACCEPT" which disabled any other check like
loadBalancerSourceRanges in the KUBE-PROXY-FIREWALL chain.
The target is now "RETURN".
2022-09-15 07:49:12 +02:00
Antonio Ojea
b84a5faaae kube-proxy use debug log level for cache operations
Level 4 is mean for debug operations.
The default level use to be level 2, on clusters with a lot of
Services this means that the kube-proxy will generate a lot of
noise on the logs, with the performance penalty associated to
it.
2022-09-14 17:57:08 +02:00
JunYang
fc6b421d97 cleanup useless check about CIDR 2022-09-14 11:43:35 +08:00
kerthcet
2b7373f336 kube-proxy: code optimization
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-09-04 19:34:22 +08:00
Kubernetes Prow Robot
9924814270
Merge pull request #108460 from Nordix/issue-72236
Prevent host access on VIP addresses in proxy-mode=ipvs
2022-09-01 12:59:18 -07:00
Sanskar Jaiswal
8b5f263cd3 add tests for initialSync usage in syncEndpoint
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-08-27 07:42:21 +00:00
Sanskar Jaiswal
b670656a09 update ipvs proxier to update realserver weights at startup
Update the IPVS proxier to have a bool `initialSync` which is set to
true when a new proxier is initialized and then set to false on all
syncs. This lets us run startup-only logic, which subsequently lets us
update the realserver only when needed and avoiding any expensive
operations.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-08-27 07:42:07 +00:00
Dan Winship
c437b15441 proxy/iptables: make part of the unit test sanity-checking optional 2022-08-24 09:02:48 -04:00
Kubernetes Prow Robot
da112dda68
Merge pull request #111806 from danwinship/kube-proxy-no-mode-fallback
remove kube-proxy mode fallback
2022-08-24 05:52:03 -07:00
Kubernetes Prow Robot
ef25013252
Merge pull request #111842 from ialidzhikov/cleanup/pkg-proxy
pkg/proxy: Replace deprecated func usage from the `k8s.io/utils/pointer` pkg
2022-08-23 20:08:08 -07:00
Kubernetes Prow Robot
9efbe6eb9b
Merge pull request #111379 from muyangren2/describe_err
wrong description
2022-08-23 16:05:17 -07:00
Dan Winship
1609017f2b kube-proxy: remove ipvs-to-iptables fallback
If the user passes "--proxy-mode ipvs", and it is not possible to use
IPVS, then error out rather than falling back to iptables.

There was never any good reason to be doing fallback; this was
presumably erroneously added to parallel the iptables-to-userspace
fallback (which only existed because we had wanted iptables to be the
default but not all systems could support it).

In particular, if the user passed configuration options for ipvs, then
they presumably *didn't* pass configuration options for iptables, and
so even if the iptables proxy is able to run, it is likely to be
misconfigured.
2022-08-16 09:30:08 -04:00
Dan Winship
9f69a3a9d4 kube-proxy: remove iptables-to-userspace fallback
Back when iptables was first made the default, there were
theoretically some users who wouldn't have been able to support it due
to having an old /sbin/iptables. But kube-proxy no longer does the
things that didn't work with old iptables, and we removed that check a
long time ago. There is also a check for a new-enough kernel version,
but it's checking for a feature which was added in kernel 3.6, and no
one could possibly be running Kubernetes with a kernel that old. So
the fallback code now never actually falls back, so it should just be
removed.
2022-08-16 09:21:34 -04:00
ialidzhikov
f2bc2ed2da pkg/proxy: Replace deprecated func usage from the k8s.io/utils/pointer pkg 2022-08-14 18:27:33 +03:00
Kubernetes Prow Robot
e16ac34361
Merge pull request #110289 from danwinship/kep-3178-source-ranges-drop
Don't use KUBE-MARK-DROP for LoadBalancerSourceRanges
2022-07-28 10:21:10 -07:00
Dan Winship
f65fbc877b proxy/iptables: remove last references to KUBE-MARK-DROP 2022-07-28 09:03:49 -04:00
Dan Winship
9313188909 proxy/iptables: Don't use KUBE-MARK-DROP for LoadBalancerSourceRanges 2022-07-28 09:03:46 -04:00
Kubernetes Prow Robot
4e5711829c
Merge pull request #111228 from Abirdcfly/220716
clean unreachable code
2022-07-27 11:35:00 -07:00
Kubernetes Prow Robot
ce433f87b4
Merge pull request #110266 from danwinship/minimize-prep-reorg
iptables proxy reorg in preparation for minimizing iptables-restore
2022-07-27 04:06:30 -07:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
muyangren2
9b29c930a2 wrong description 2022-07-25 13:41:59 +08:00
Kubernetes Prow Robot
7d72ccf9a8
Merge pull request #110957 from papagalu/kp_remove_hnsv1
kube-proxy: windows: Removed hnsV1
2022-07-20 04:02:38 -07:00
BinacsLee
f1c9a70b47 cleanup: simplify the function implementation of IPSet 2022-07-20 10:13:57 +08:00
Abirdcfly
f71718d644 clean Unreachable code
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-19 20:42:09 +08:00