From 5fdfc8a4250a22783b39f77919864ad3af0c1f01 Mon Sep 17 00:00:00 2001 From: raydds Date: Tue, 14 Jan 2020 12:14:33 -0500 Subject: [PATCH] Create a horizontal pod autoscaler --- deploy/azure/autoscaling.yml | 40 +++++++++++++++++++++++++++++++++ deploy/azure/kustomization.yaml | 1 + 2 files changed, 41 insertions(+) create mode 100644 deploy/azure/autoscaling.yml diff --git a/deploy/azure/autoscaling.yml b/deploy/azure/autoscaling.yml new file mode 100644 index 00000000..714e7df3 --- /dev/null +++ b/deploy/azure/autoscaling.yml @@ -0,0 +1,40 @@ +--- +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + labels: + app: atst + name: atst + namespace: atat +spec: + minReplicas: 2 + maxReplicas: 10 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: atst + metrics: + - type: Resource + resource: + name: cpu + targetAverageUtilization: 60 +--- +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + labels: + app: atst + name: atst-worker + namespace: atat +spec: + minReplicas: 2 + maxReplicas: 10 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: atst + metrics: + - type: Resource + resource: + name: cpu + targetAverageUtilization: 60 diff --git a/deploy/azure/kustomization.yaml b/deploy/azure/kustomization.yaml index 9dee809c..d0162394 100644 --- a/deploy/azure/kustomization.yaml +++ b/deploy/azure/kustomization.yaml @@ -12,3 +12,4 @@ resources: - acme-challenges.yml - aadpodidentity.yml - nginx-snippets.yml + - autoscaling.yml