From d757e8fd4ee93c32a6ff11088968c6aac8e02144 Mon Sep 17 00:00:00 2001 From: Victor Barba Martin Date: Mon, 19 Jul 2021 19:17:05 +0200 Subject: [PATCH] setup namespaces --- .../webrtc-be-autoscaler.yaml | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/k8s/linode-autoscaler/webrtc-be-autoscaler.yaml b/k8s/linode-autoscaler/webrtc-be-autoscaler.yaml index b6c5afd..d9ece1a 100644 --- a/k8s/linode-autoscaler/webrtc-be-autoscaler.yaml +++ b/k8s/linode-autoscaler/webrtc-be-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: k8s-autoscaler - namespace: default ####### Change this to the actual namespace + namespace: coturn spec: replicas: 1 strategy: @@ -50,6 +50,63 @@ spec: value: "1" - name: AUTOSCALE_WAIT_TIME_AFTER_SCALING value: "150" + resources: + requests: + memory: 32Mi + limits: + memory: 32Mi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: k8s-autoscaler + namespace: webrtc-be +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + selector: + matchLabels: + app: k8s-autoscale + template: + metadata: + labels: + app: k8s-autoscale + spec: + containers: + - name: k8s-autoscale + command: ["/bin/sleep"] + args: ["300"] + image: gcr.io/tough-craft-276813/linode-autoscaler:prod-0.1.5 ###{{linode_autoscaler_image}} ####### CHANGE THIS TO YOUR ACTUAL DOCKER IMAGE + env: + - name: LINODE_PERSONAL_ACCCESS_TOKEN + valueFrom: + secretKeyRef: + name: linode-personal-access-token-k8s-autoscaler ####### LINODE PERSONAL ACCESS TOKEN SECRET + key: token + - name: LINODE_LKE_CLUSTER_ID + value: "29062" + - name: LINODE_LKE_CLUSTER_POOL_ID + value: "47218" + - name: AUTOSCALE_TRIGGER + value: "cpu" + - name: AUTOSCALE_TRIGGER_TYPE + value: "used" + - name: AUTOSCALE_UP_PERCENTAGE + value: "10" + - name: AUTOSCALE_DOWN_PERCENTAGE + value: "30" + - name: AUTOSCALE_QUERY_INTERVAL + value: "30" + - name: AUTOSCALE_THRESHOLD_COUNT + value: "3" + - name: AUTOSCALE_NUMBER_OF_NODES + value: "1" + - name: AUTOSCALE_WAIT_TIME_AFTER_SCALING + value: "150" resources: requests: memory: 32Mi