Skip to content

Commit a48f868

Browse files
committed
Updates for 20231018
1 parent 225b23b commit a48f868

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

120_kubernetes/ci_cd/slides.md

+37-10
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ XXX
5050

5151
---
5252

53-
## Horizontal pod autoscaler (HPA)
54-
5553
```yaml
5654
apiVersion: autoscaling/v1
5755
kind: HorizontalPodAutoscaler
@@ -64,23 +62,52 @@ spec:
6462
name: my-app
6563
minReplicas: 1
6664
maxReplicas: 10
67-
targetCPUUtilizationPercentage: 50
65+
metrics:
66+
- type: Resource
67+
resource:
68+
name: cpu
69+
target:
70+
type: Utilization
71+
averageUtilization: 50
6872
```
69-
<!-- .element: style="float: right; width: 22em;" -->
73+
<!-- .element: style="float: right; width: 18em; margin-top: 1em; margin-left: 1em;" -->
7074
71-
Change replicas based on CPU consumption
75+
## Horizontal pod<br/>autoscaler (HPA) 1/
7276
73-
XXX
77+
Manually scaling pods is time consuming
78+
79+
HPA [](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) changes replicas automagically
80+
81+
Supports CPU and memory usage
7482
7583
### Demo
7684
77-
XXX deploy nginx
85+
Deploy nginx and HPA
86+
87+
Create load and watch hpa scale nginx
88+
89+
---
7890
79-
XXX add hpa
91+
## Horizontal pod autoscaler (HPA) 2/2
92+
93+
### Internals
94+
95+
Prerequisites: metrics-server []()
96+
97+
Checks every 15 seconds
98+
99+
Calculates the required number of replicas:
100+
101+
```plaintext
102+
desiredReplicas
103+
= ceil[currentReplicas * (currentMetricValue / desiredMetricValue)]
104+
```
105+
<!-- .element: style="font-size: smaller; width: 40em;" -->
80106

81-
XXX create load
107+
Configurable behaviour:
82108

83-
XXX watch hpa scale nginx
109+
- Scaling policies [](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior)
110+
- Stabilization window [](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#stabilization-window)
84111

85112
---
86113

0 commit comments

Comments
 (0)