From 519a86a9a74fa025f0aa04503236bdd4e6382b31 Mon Sep 17 00:00:00 2001 From: Nicholasfz Date: Wed, 11 Aug 2021 17:40:41 -0300 Subject: [PATCH 1/3] Update number of replicas on staging --- deploy/staging.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/staging.yaml b/deploy/staging.yaml index 9ba0ecd..5971455 100644 --- a/deploy/staging.yaml +++ b/deploy/staging.yaml @@ -6,7 +6,7 @@ metadata: labels: app: nisia spec: - replicas: 2 + replicas: 1 selector: matchLabels: app: nisia From c19a66d6a653463cc671f3d9771c15ed22d32c93 Mon Sep 17 00:00:00 2001 From: Nicholasfz Date: Wed, 11 Aug 2021 17:41:38 -0300 Subject: [PATCH 2/3] Define resource limits on staging --- deploy/staging.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/deploy/staging.yaml b/deploy/staging.yaml index 5971455..5859c51 100644 --- a/deploy/staging.yaml +++ b/deploy/staging.yaml @@ -21,6 +21,34 @@ spec: imagePullPolicy: Always ports: - containerPort: 80 + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: 50m + memory: 128Mi + readinessProbe: + initialDelaySeconds: 1 + periodSeconds: 2 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 1 + httpGet: + host: + scheme: HTTP + path: / + port: 80 + livenessProbe: + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 2 + httpGet: + host: + scheme: HTTP + path: / + port: 80 envFrom: - secretRef: name: nisia From b3c8934d89c1b5142004fbce294adf5603813cfd Mon Sep 17 00:00:00 2001 From: Nicholasfz Date: Wed, 11 Aug 2021 17:43:23 -0300 Subject: [PATCH 3/3] Update number of replicas and resource limits on production --- deploy/production.yaml | 51 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/deploy/production.yaml b/deploy/production.yaml index 3157b17..6613594 100644 --- a/deploy/production.yaml +++ b/deploy/production.yaml @@ -21,12 +21,61 @@ spec: imagePullPolicy: Always ports: - containerPort: 80 + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: 50m + memory: 128Mi + readinessProbe: + initialDelaySeconds: 1 + periodSeconds: 2 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 1 + httpGet: + host: + scheme: HTTP + path: / + port: 80 + livenessProbe: + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 2 + httpGet: + host: + scheme: HTTP + path: / + port: 80 envFrom: - secretRef: name: nisia imagePullSecrets: - name: regcred - +--- +apiVersion: autoscaling/v2beta2 +kind: HorizontalPodAutoscaler +metadata: + name: nisia + namespace: production + labels: + app: nisia +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: nisia + minReplicas: 2 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 70 --- apiVersion: v1 kind: Service