You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/exercises/project/project.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,56 +248,56 @@ Os testes de carga são uma parte importante do desenvolvimento de software, poi
248
248
249
249
!!! example "Example of HPA"
250
250
251
-
Open three terminal windows, one for each tab below.
251
+
Open three terminal windows, one for each tab below.
252
252
253
253
254
-
=== "1. Create the HPA"
254
+
=== "1. Create the HPA"
255
255
256
-
Create the HPA (Horizontal Pod Autoscaler) for the `gateway` deployment. The HPA will automatically scale the number of pods in the deployment based on CPU usage.
256
+
Create the HPA (Horizontal Pod Autoscaler) for the `gateway` deployment. The HPA will automatically scale the number of pods in the deployment based on CPU usage.
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
267
-
gateway Deployment/gateway cpu: 1%/50% 1 10 1 66s
268
-
```
264
+
``` { .bash .copy }
265
+
kubectl get hpa
266
+
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
267
+
gateway Deployment/gateway cpu: 1%/50% 1 10 1 66s
268
+
```
269
269
270
-
Watch the HPA status:
270
+
Watch the HPA status:
271
271
272
-
``` { .bash .copy }
273
-
watch -n 1 'kubectl get hpa'
274
-
```
272
+
``` { .bash .copy }
273
+
watch -n 1 'kubectl get hpa'
274
+
```
275
275
276
-
---
276
+
---
277
277
278
-
At the end of the test, delete the HPA:
278
+
At the end of the test, delete the HPA:
279
279
280
-
``` { .bash .copy }
281
-
kubectl delete hpa gateway
282
-
```
280
+
``` { .bash .copy }
281
+
kubectl delete hpa gateway
282
+
```
283
283
284
-
=== "2. Monitor the Pods"
284
+
=== "2. Monitor the Pods"
285
285
286
-
Open another terminal window and monitor the pods in the `gateway` deployment:
286
+
Open another terminal window and monitor the pods in the `gateway` deployment:
287
287
288
-
``` { .bash .copy }
289
-
watch -n 1 'kubectl get pods -l app=gateway'
290
-
```
288
+
``` { .bash .copy }
289
+
watch -n 1 'kubectl get pods -l app=gateway'
290
+
```
291
291
292
-
=== "3. Run the Load Test"
292
+
=== "3. Run the Load Test"
293
293
294
-
Open another terminal window and run the load test against the `gateway` deployment. This will simulate a high load on the application, causing the HPA to scale the number of pods in the deployment.
294
+
Open another terminal window and run the load test against the `gateway` deployment. This will simulate a high load on the application, causing the HPA to scale the number of pods in the deployment.
295
295
296
-
``` { .bash .copy }
297
-
kubectl run -i --tty load-generator --rm --image=busybox:1.28 --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://gateway/info; done"
298
-
```
296
+
``` { .bash .copy }
297
+
kubectl run -i --tty load-generator --rm --image=busybox:1.28 --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://gateway/info; done"
298
+
```
299
299
300
-
In the command above, the `wget` command is used to send requests to the `/info` endpoint of the `gateway` deployment. The `while` loop will continue to send requests until you stop it (e.g., by pressing `Ctrl+C`). The interval between requests is set to 0.01 seconds, which simulates a high load on the application. Try to increase and decrease the interval to see how the HPA reacts to different loads.
300
+
In the command above, the `wget` command is used to send requests to the `/info` endpoint of the `gateway` deployment. The `while` loop will continue to send requests until you stop it (e.g., by pressing `Ctrl+C`). The interval between requests is set to 0.01 seconds, which simulates a high load on the application. Try to increase and decrease the interval to see how the HPA reacts to different loads.
0 commit comments