iptables_generated_rules_test.go
returns the number of iptables generated rules based on the following inputs:
- ServiceType: NodePort, ClusterIP, LoadBalancer
- Max number of Services
- Max number of Endpoints of Services
- Increment: It increments in each iteration the number of services and endpoints per services until it reaches the defined maximumts
It returns, in CSV format, a table with:
- ServiceType
- Services
- Endpoint/Service
- FilterRules
- NATRules
- Latency
-
In your kubernetes repository folder, drop the file
iptables_generated_rules_test.go
inpkg/proxy/iptables
-
Edit the Input variables in the file at your convinience
// Define experiment variables
maxServices := 1005
maxEndpoints := 502
increment := 500
serviceTypes := []v1.ServiceType{v1.ServiceTypeClusterIP, v1.ServiceTypeNodePort, v1.ServiceTypeLoadBalancer}
- Run with go test, use the -v flag:
/usr/bin/go test -timeout 100s -run ^TestNumberIptablesRules$ k8s.io/kubernetes/pkg/proxy/iptables -v SIGINT master
=== RUN TestNumberIptablesRules
=== RUN TestNumberIptablesRules/ClusterIP-1-1
=== RUN TestNumberIptablesRules/ClusterIP-501-1
=== RUN TestNumberIptablesRules/ClusterIP-1001-1
=== RUN TestNumberIptablesRules/ClusterIP-1-501
=== RUN TestNumberIptablesRules/ClusterIP-501-501
=== RUN TestNumberIptablesRules/ClusterIP-1001-501
=== RUN TestNumberIptablesRules/NodePort-1-1
=== RUN TestNumberIptablesRules/NodePort-501-1
=== RUN TestNumberIptablesRules/NodePort-1001-1
=== RUN TestNumberIptablesRules/NodePort-1-501
=== RUN TestNumberIptablesRules/NodePort-501-501
=== RUN TestNumberIptablesRules/NodePort-1001-501
=== RUN TestNumberIptablesRules/LoadBalancer-1-1
=== RUN TestNumberIptablesRules/LoadBalancer-501-1
=== RUN TestNumberIptablesRules/LoadBalancer-1001-1
=== RUN TestNumberIptablesRules/LoadBalancer-1-501
=== RUN TestNumberIptablesRules/LoadBalancer-501-501
=== RUN TestNumberIptablesRules/LoadBalancer-1001-501
ServiceType,Services,Endpoint/Service,FilterRules,NATRules,Latency
ClusterIP,1,1,5,11,1.16653ms
ClusterIP,501,1,5,2511,8.228011ms
ClusterIP,1001,1,5,5011,14.535362ms
ClusterIP,1,501,5,1511,3.95692ms
ClusterIP,501,501,5,754011,804.495785ms
ClusterIP,1001,501,5,1506511,1.480063753s
NodePort,1,1,5,13,452.31µs
NodePort,501,1,5,3513,6.81702ms
NodePort,1001,1,5,7013,24.221882ms
NodePort,1,501,5,1513,2.625701ms
NodePort,501,501,5,755013,823.539865ms
NodePort,1001,501,5,1508513,1.530764605s
LoadBalancer,1,1,5,19,473.241µs
LoadBalancer,501,1,5,6519,9.170061ms
LoadBalancer,1001,1,5,13019,20.564253ms
LoadBalancer,1,501,5,1519,2.07762ms
LoadBalancer,501,501,5,758019,841.162086ms
LoadBalancer,1001,501,5,1514519,1.681468323s