Skip to content

Commit 678f8a1

Browse files
authored
Init
1 parent ffca1c3 commit 678f8a1

File tree

1 file changed

+34
-39
lines changed

1 file changed

+34
-39
lines changed

README.md

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@
33
[![Build](https://github.com/DevSecOpsSamples/gcp-golang-performance-test/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/DevSecOpsSamples/gcp-golang-performance-test/actions/workflows/build.yml)
44
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=DevSecOpsSamples_gcp-golang-performance-test&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=DevSecOpsSamples_gcp-golang-performance-test) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=DevSecOpsSamples_gcp-golang-performance-test&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=DevSecOpsSamples_gcp-golang-performance-test)
55

6-
Performance testing with https://echo.labstack.com application on GKE.
6+
Performance testing on GKE using the https://echo.labstack.com application.
77

88

99
## Table of Contents
1010

11-
- [Step1: Create a GKE cluster and namespaces](#1-create-a-gke-cluster)
12-
- [Step2: Build and push to GCR](#2-build-and-push-to-gcr)
13-
- [Step3: Ingress with Network Endpoint Group (NEG)](#3-ingress-with-network-endpoint-groupneg)
14-
- Manifest
15-
- Deploy ingress-neg-api
16-
- Screenshots
17-
- [Step4: LoadBalancer Type with NodePort](#4-loadbalancer-type-with-nodeport)
18-
- Manifest
19-
- Deploy loadbalancer-type-api
20-
- Screenshots
21-
- [Step5: NodePort Type](#5-nodeport-type)
22-
- Manifest
23-
- Deploy nodeport-type-api
24-
- Create a firewall rule for the node port
11+
- [1. Create a GKE cluster](#1-create-a-gke-cluster)
12+
- [2. Deploy two applications for checking the performance per Pod and scaling](#2-deploy-two-applications-for-checking-the-performance-per-pod-and-scaling)
13+
- [2.1. Deploy for performance of one Pod](#21-deploy-for-performance-of-one-pod)
14+
- [2.2. Deploy for Scaling Test](#22-deploy-for-scaling-test)
15+
- [3. Performance Testing](#3-performance-testing)
16+
- [3.1. Install the Taurus](#31-install-the-taurus)
17+
- [3.2. Test for performance of one Pod](#32-test-for-performance-of-one-pod)
18+
- [3.3. Test with auto scaling](#33-test-with-auto-scaling)
2519
- [Cleanup](#6-cleanup)
2620

2721
---
@@ -79,9 +73,9 @@ kubectl get namespaces
7973
kubectl create namespace echo-test
8074
```
8175

82-
Two ddeployments may take around 5 minutes to create a load balancer, including health checking.
76+
Two deployments may take around 5 minutes to create a load balancer, including health checking.
8377

84-
## 3. Deploy for performance of one Pod
78+
## 2.1. Deploy for performance of one Pod
8579

8680
To check request per seconds(RPS) WITHOUT scaling, create and deploy K8s Deployment, Service, HorizontalPodAutoscaler, Ingress, and GKE BackendConfig using the [go-echo-api-onepod-template.yaml](app/go-echo-api-onepod-template.yaml) template file:
8781

@@ -93,7 +87,7 @@ kubectl get namespaces
9387
kubectl apply -f go-echo-api-onepod.yaml -n echo-test --dry-run=client
9488
```
9589

96-
Confirm that pod configuration and logs after deployment:
90+
Confirm Pod logs and configuration after deployment:
9791

9892
```bash
9993
kubectl logs -l app=go-echo-api-onepod -n echo-test
@@ -103,7 +97,7 @@ kubectl describe pods -n echo-test
10397
kubectl get ingress go-echo-api-onepod-ingress -n echo-test
10498
```
10599

106-
## 4. Deploy for Scaling Test
100+
## 2.2. Deploy for Scaling Test
107101

108102
To check request per seconds(RPS) with scaling, create and deploy K8s Deployment, Service, HorizontalPodAutoscaler, Ingress, and GKE BackendConfig using the [go-echo-api-template.yaml](app/go-echo-api-template.yaml) template file:
109103

@@ -118,7 +112,7 @@ kubectl apply -f go-echo-api.yaml -n echo-test --dry-run=client
118112
kubectl apply -f go-echo-api.yaml -n echo-test
119113
```
120114

121-
Confirm that pod configuration and logs after deployment:
115+
Confirm Pod logs and configuration after deployment:
122116

123117
```bash
124118
kubectl logs -l app=go-echo-api -n echo-test
@@ -139,50 +133,51 @@ echo ${LB_IP_ADDRESS}
139133
curl http://${LB_IP_ADDRESS}/
140134
```
141135

142-
## 5. Performance Testing
136+
## 3. Performance Testing
143137

144-
### 5.1. Performance of one Pod
138+
### 3.1. Install the Taurus
139+
140+
https://gettaurus.org/install/Installation/
141+
142+
```bash
143+
sudo apt-get update -y
144+
sudo apt-get install python3 default-jre-headless python3-tk python3-pip python3-dev libxml2-dev libxslt-dev zlib1g-dev net-tools -y
145+
sudo python3 -m pip install bzt
146+
sudo apt-get install htop -y
147+
```
148+
149+
### 3.2. Test for performance of one Pod
145150

146151
```bash
147152
cd test
148-
bzt echo-bzt.yaml
153+
# test with 300 threads and connection:close option
154+
bzt echo-bzt-onepod.yaml
149155
```
150156

151-
[test/echo-bzt.yaml](./test/echo-bzt.yaml)
157+
[test/echo-bzt-onepod.yaml](./test/echo-bzt-onepod.yaml)
152158

153159
```bash
154160
kubectl describe hpa go-echo-api-onepod-hpa -n echo-test
155161

156162
kubectl get hpa go-echo-api-onepod-hpa -n echo-test -w
157163
```
158164

159-
160-
### 5.2. Scaling test
161-
162-
https://gettaurus.org/install/Installation/
163-
164-
```bash
165-
sudo apt-get update -y
166-
sudo apt-get install python3 default-jre-headless python3-tk python3-pip python3-dev libxml2-dev libxslt-dev zlib1g-dev net-tools -y
167-
sudo python3 -m pip install bzt
168-
sudo apt-get install htop -y
169-
```
165+
### 3.3. Test with auto scaling
170166

171167
```bash
172168
cd test
169+
# test with 2000 threads and connection:close option
173170
bzt echo-bzt.yaml
174171
```
175172

173+
[test/echo-bzt.yaml](./test/echo-bzt.yaml)
174+
176175
```bash
177176
kubectl describe hpa go-echo-api-hpa -n echo-test
178177

179178
kubectl get hpa go-echo-api-hpa -n echo-test -w
180179
```
181180

182-
```bash
183-
kubectl scale deployment go-echo-api -n echo-test --replicas=0
184-
```
185-
186181
## Cleanup
187182

188183
```bash

0 commit comments

Comments
 (0)