feat: add scaffolding for section on hpa/vpa

This commit is contained in:
Rémy-Christophe Schermesser 2019-05-09 15:42:23 +02:00
parent aab79e4c72
commit 79535df518
2 changed files with 38 additions and 0 deletions

12
16-hpa-vpa/02-hpa.yml Normal file
View File

@ -0,0 +1,12 @@
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: simple-hpa
spec:
maxReplicas: 10
minReplicas: 3
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: simple-deployment
targetCPUUtilizationPercentage: 80

26
16-hpa-vpa/README.md Normal file
View File

@ -0,0 +1,26 @@
# HPA, VPA
HPA means `Horizontal Pod Autoscaler`. It automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with custom metrics support, on some other application-provided metrics).
Let's take an example with CPU usage:
```yaml
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: simple-hpa
spec:
maxReplicas: 10
minReplicas: 3
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: simple-deployment
targetCPUUtilizationPercentage: 80
```
* `spec`: the spec for the HPA
* `maxReplicas`: the maximum number of pods running
* `minReplicas`: the minimum number of pods running
* `scaleTargetRef`: what this HPA targets, here a `Deployment` named `simple-deployment`
* `targetCPUUtilizationPercentage`: the percentage of CPU utilization to cross to activate the HPA