kubernetes/pkg/proxy
Surya Seetharaman d3fe48e848 Kube-proxy: perf-enhancement: Reduce NAT table KUBE-SERVICES/NODEPORTS chain rules
The nat KUBE-SERVICES chain is called from OUTPUT and PREROUTING stages. In
clusters with large number of services, the nat-KUBE-SERVICES chain is the largest
chain with for eg: 33k rules. This patch aims to move the KubeMarkMasq rules from
the kubeServicesChain into the respective KUBE-SVC-* chains. This way during each
packet-rule matching we won't have to traverse the MASQ rules of all services which
get accumulated in the KUBE-SERVICES and/or KUBE-NODEPORTS chains. Since the
jump to KUBE-MARK-MASQ ultimately sets the 0x400 mark for nodeIP SNAT, it should not
matter whether the jump is made from KUBE-SERVICES or KUBE-SVC-* chains.

Specifically we change:

1) For ClusterIP svc, we move the KUBE-MARK-MASQ jump rule from KUBE-SERVICES
chain into KUBE-SVC-* chain.
2) For ExternalIP svc, we move the KUBE-MARK-MASQ jump rule in the case of
non-ServiceExternalTrafficPolicyTypeLocal from KUBE-SERVICES
chain into KUBE-SVC-* chain.
3) For NodePorts svc, we move the KUBE-MARK-MASQ jump rule in case of
non-ServiceExternalTrafficPolicyTypeLocal from KUBE-NODEPORTS chain to
KUBE-SVC-* chain.
4) For load-balancer svc, we don't change anything since it is already svc specific
due to creation of KUBE-FW-* chains per svc.

This would cut the rules per svc in KUBE-SERVICES and KUBE-NODEPORTS in half.
2021-04-21 16:41:03 +02:00
..
apis Graduate EndpointSlice feature gate to GA 2021-03-06 15:58:47 -08:00
config hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
healthcheck hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
iptables Kube-proxy: perf-enhancement: Reduce NAT table KUBE-SERVICES/NODEPORTS chain rules 2021-04-21 16:41:03 +02:00
ipvs Merge pull request #99448 from JornShen/use_exist_utils_nets_replace_parseExcludedCIDRs 2021-04-17 19:32:36 -07:00
metaproxier add node handlers to the metaproxier 2021-04-05 02:05:18 +02:00
metrics kube-proxy iptables expose number of rules metrics 2021-03-05 10:00:38 +01:00
userspace Merge pull request #97837 from JornShen/proxier_userspace_structured_logging 2021-03-05 13:25:42 -08:00
util Kube-proxy: perf-enhancement: Reduce NAT table KUBE-SERVICES/NODEPORTS chain rules 2021-04-21 16:41:03 +02:00
winkernel Merge pull request #99958 from sbangari/winkubeproxylbservicefix 2021-03-10 00:35:35 -08:00
winuserspace hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
doc.go
endpoints_test.go kube-proxy network programming latency on restarts 2021-04-07 19:19:02 +02:00
endpoints.go kube-proxy network programming latency on restarts 2021-04-07 19:19:02 +02:00
endpointslicecache_test.go kube-proxy: add endpointslice cache unit tests for terminating endpoints 2021-01-11 16:17:58 -05:00
endpointslicecache.go Adding support for TopologyAwareHints to kube-proxy 2021-03-08 15:37:47 -08:00
OWNERS pkg/proxy: add sig-network-approvers/sig-network-reviewers to OWNERS files 2019-05-13 10:30:29 -05:00
service_test.go kube-proxy network programming latency on restarts 2021-04-07 19:19:02 +02:00
service.go Adding support for TopologyAwareHints to kube-proxy 2021-03-08 15:37:47 -08:00
topology_test.go Updating Topology Aware Hints to support "Auto" value for annotation 2021-03-31 15:58:42 -07:00
topology.go Updating Topology Aware Hints to support "Auto" value for annotation 2021-03-31 15:58:42 -07:00
types.go Adding support for TopologyAwareHints to kube-proxy 2021-03-08 15:37:47 -08:00