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 diff --git a/deploy/staging.yaml b/deploy/staging.yaml index 9ba0ecd..5859c51 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 @@ -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