kubernetes/pkg/proxy
Dan Winship 28253f6030 proxy/ipvs: Use DROP directly rather than KUBE-MARK-DROP
The ipvs proxier was figuring out LoadBalancerSourceRanges matches in
the nat table and using KUBE-MARK-DROP to mark unmatched packets to be
dropped later. But with ipvs, unlike with iptables, DNAT happens after
the packet is "delivered" to the dummy interface, so the packet will
still be unmodified when it reaches the filter table (the first time)
so there's no reason to split the work between the nat and filter
tables; we can just do it all from the filter table and call DROP
directly.

Before:

  - KUBE-LOAD-BALANCER (in nat) uses kubeLoadBalancerFWSet to match LB
    traffic for services using LoadBalancerSourceRanges, and sends it
    to KUBE-FIREWALL.

  - KUBE-FIREWALL uses kubeLoadBalancerSourceCIDRSet and
    kubeLoadBalancerSourceIPSet to match allowed source/dest combos
    and calls "-j RETURN".

  - All remaining traffic that doesn't escape KUBE-FIREWALL is sent to
    KUBE-MARK-DROP.

  - Traffic sent to KUBE-MARK-DROP later gets dropped by chains in
    filter created by kubelet.

After:

  - All INPUT and FORWARD traffic gets routed to KUBE-PROXY-FIREWALL
    (in filter). (We don't use "KUBE-FIREWALL" any more because
    there's already a chain in filter by that name that belongs to
    kubelet.)

  - KUBE-PROXY-FIREWALL sends traffic matching kubeLoadbalancerFWSet
    to KUBE-SOURCE-RANGES-FIREWALL

  - KUBE-SOURCE-RANGES-FIREWALL uses kubeLoadBalancerSourceCIDRSet and
    kubeLoadBalancerSourceIPSet to match allowed source/dest combos
    and calls "-j RETURN".

  - All remaining traffic that doesn't escape
    KUBE-SOURCE-RANGES-FIREWALL is dropped (directly via "-j DROP").

  - (KUBE-LOAD-BALANCER in nat is now used only to set up masquerading)
2022-06-22 13:02:22 -04:00
..
apis Add validation for bridge-interface and interface-name-prefix 2022-03-25 20:06:12 +01:00
config OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
healthcheck kube-proxy: fix healthz return unexpect code 200 2022-05-04 14:05:24 +08:00
iptables Merge pull request #109844 from danwinship/iptables-tests-new 2022-06-10 14:27:44 -07:00
ipvs proxy/ipvs: Use DROP directly rather than KUBE-MARK-DROP 2022-06-22 13:02:22 -04:00
metaproxier Migrate cmd/proxy/app and pkg/proxy/meta_proxier to structured logging (#104928) 2021-09-14 20:50:40 -07:00
metrics Add sync_proxy_rules_no_local_endpoints_total metric 2022-03-31 18:54:23 +00:00
userspace fix: formatting 2022-03-17 21:27:14 -03:00
util Fix: Add test cases for method IsZeroCIDR() in pkg/proxy/util/utils_test.go 2022-05-25 10:47:33 +08:00
winkernel Winkernel proxier cache HNS data to improve syncProxyRules performance 2022-04-15 13:31:31 -07:00
winuserspace remove ReallyCrashForTesting and cleaned up some references to HandleCrash behavior 2021-11-29 20:00:10 +00:00
doc.go
endpoints_test.go Graduate EndpointSliceProxying and WindowsEndpointSliceProxying Gates 2021-07-07 13:33:30 -07:00
endpoints.go proxy/iptables: fix up endpoint chain name computation 2022-03-18 16:10:33 -04:00
endpointslicecache_test.go Kubeproxy uses V1 EndpointSlice 2021-06-30 18:41:57 -07:00
endpointslicecache.go proxy/iptables: fix up endpoint chain name computation 2022-03-18 16:10:33 -04:00
OWNERS Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
service_test.go run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
service.go kube-proxy: Renames for readability 2022-03-30 09:55:32 -07:00
topology_test.go kube-proxy: Renames for readability 2022-03-30 09:55:32 -07:00
topology.go pkg/proxy: update CategorizeEndpoints to apply ProxyTerminatingEndpoints to all traffic policies 2022-03-29 11:06:58 -04:00
types.go kube-proxy: Renames for readability 2022-03-30 09:55:32 -07:00