diff --git a/deploy/azure/autoscaling.yml b/deploy/azure/autoscaling.yml new file mode 100644 index 00000000..e208d943 --- /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: 1 + maxReplicas: 10 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: atst-worker + metrics: + - type: Resource + resource: + name: cpu + targetAverageUtilization: 60 diff --git a/deploy/azure/azure.yml b/deploy/azure/azure.yml index aa13b67e..1300ed34 100644 --- a/deploy/azure/azure.yml +++ b/deploy/azure/azure.yml @@ -15,7 +15,6 @@ spec: selector: matchLabels: role: web - replicas: 4 strategy: type: RollingUpdate template: @@ -169,7 +168,6 @@ spec: selector: matchLabels: role: worker - replicas: 2 strategy: type: RollingUpdate template: @@ -207,10 +205,10 @@ spec: resources: requests: memory: 280Mi - cpu: 20m + cpu: 400m limits: memory: 280Mi - cpu: 20m + cpu: 400m volumes: - name: pgsslrootcert configMap: 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 diff --git a/deploy/overlays/cloudzero-dev/kustomization.yaml b/deploy/overlays/cloudzero-dev/kustomization.yaml index ee6f3a0c..24705531 100644 --- a/deploy/overlays/cloudzero-dev/kustomization.yaml +++ b/deploy/overlays/cloudzero-dev/kustomization.yaml @@ -5,7 +5,6 @@ resources: - namespace.yml - reset-cron-job.yml patchesStrategicMerge: - - replica_count.yml - ports.yml - envvars.yml - flex_vol.yml diff --git a/deploy/overlays/cloudzero-dev/replica_count.yml b/deploy/overlays/cloudzero-dev/replica_count.yml deleted file mode 100644 index 272286f7..00000000 --- a/deploy/overlays/cloudzero-dev/replica_count.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: atst -spec: - replicas: 2 ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: atst-worker -spec: - replicas: 1 diff --git a/deploy/overlays/staging/kustomization.yaml b/deploy/overlays/staging/kustomization.yaml index ee6f3a0c..24705531 100644 --- a/deploy/overlays/staging/kustomization.yaml +++ b/deploy/overlays/staging/kustomization.yaml @@ -5,7 +5,6 @@ resources: - namespace.yml - reset-cron-job.yml patchesStrategicMerge: - - replica_count.yml - ports.yml - envvars.yml - flex_vol.yml diff --git a/deploy/overlays/staging/replica_count.yml b/deploy/overlays/staging/replica_count.yml deleted file mode 100644 index 272286f7..00000000 --- a/deploy/overlays/staging/replica_count.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: atst -spec: - replicas: 2 ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: atst-worker -spec: - replicas: 1