Configurar Horizontal Pod Autoscaler en Kubernetes
minikube addons enable metrics-serverkubectl apply -f https://k8s.io/examples/application/php-apache.yamlkubectl autoscale deployment php-apache --cpu-percent=50 --min=1 --max=10 kubectl run -it --rm load-generator --image=busybox /bin/sh**while true; do wget -q -O- http://php-apache; done**kubectl get hpa -wapiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: php-apache
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: php-apache
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
Enlaces de referencia
Última actualización