From bbb8206772f4f5beba81339719c20fa9aa7dec41 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 5 Sep 2023 18:34:10 -1000 Subject: [PATCH] Add autoscaler to kustomize flavour --- .../kustomize/production/autoscaler.yaml | 24 +++++++++++++++++++ .../kustomize/production/kustomization.yaml | 1 + 2 files changed, 25 insertions(+) create mode 100644 k8s/code.org/kustomize/production/autoscaler.yaml diff --git a/k8s/code.org/kustomize/production/autoscaler.yaml b/k8s/code.org/kustomize/production/autoscaler.yaml new file mode 100644 index 0000000000000..e3fefdf062fa9 --- /dev/null +++ b/k8s/code.org/kustomize/production/autoscaler.yaml @@ -0,0 +1,24 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: dashboard +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: dashboard + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50 + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: 50 diff --git a/k8s/code.org/kustomize/production/kustomization.yaml b/k8s/code.org/kustomize/production/kustomization.yaml index afdc774f1de6e..ba01bd3b99c66 100644 --- a/k8s/code.org/kustomize/production/kustomization.yaml +++ b/k8s/code.org/kustomize/production/kustomization.yaml @@ -6,3 +6,4 @@ bases: resources: - locals.yaml +- dashboard-autoscaler.yaml \ No newline at end of file