- Deploy the backends with the number of replicas we desire (we can always use kubectl later to scale up or down)
kubectl apply -f backend.yaml
- I recommend use the ClusterIP the Service and not depend on DNS since we just want to test the IP traffic
kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 4d3h
test-service ClusterIP 10.96.0.23 <none> 80/TCP 13m
In this case is 10.96.0.3
- We can do manual tests just runnin an httpd:2 container
kubectl run ab1 --image apache:2
# ab -c 100 -t 2 -v 1 http://10.96.0.23:80/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.96.0.23 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Finished 16021 requests
Server Software:
Server Hostname: 10.96.0.23
Server Port: 80
- If we can stress more the Service we can run multiple clients in parallel using a Job an adjunsting the completion and parallelism parameters
$ kubectl apply -f tester.yaml
$ kubectl get jobs
NAME COMPLETIONS DURATION AGE
abtest 12/12 54s 5m19s
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
ab1 0/1 ImagePullBackOff 0 22m
ab2 1/1 Running 0 21m
abtest-2dpdr 0/1 Completed 0 5m11s
abtest-2rz6p 0/1 Completed 0 5m24s
abtest-4lbsw 0/1 Completed 0 5m36s
abtest-5456b 0/1 Completed 0 4m56s
abtest-57277 0/1 Completed 0 4m58s
abtest-b6lll 0/1 Completed 0 5m11s
abtest-bzj7h 0/1 Completed 0 5m24s
abtest-dzcvh 0/1 Completed 0 5m36s
abtest-g4bg5 0/1 Completed 0 5m36s
abtest-jc6qp 0/1 Completed 0 5m24s
abtest-rptd8 0/1 Completed 0 5m10s
abtest-wt9ft 0/1 Completed 0 4m57s