From c1d18e0fe57c9ed04ad84e7303da3ebcf5aedcd3 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 24 Jul 2021 22:36:48 -0400 Subject: [PATCH] Scaling based on CPU usage. --- kubernetes/autoscale/k8s/autoscale.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kubernetes/autoscale/k8s/autoscale.yaml b/kubernetes/autoscale/k8s/autoscale.yaml index 6f37a7b..8e0a1f9 100644 --- a/kubernetes/autoscale/k8s/autoscale.yaml +++ b/kubernetes/autoscale/k8s/autoscale.yaml @@ -48,3 +48,17 @@ spec: ports: - port: 80 targetPort: "http" +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: autoscale-test + namespace: default +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: autoscale-test + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50