From 0b5da76a2c6bd276e42a5064800650b34a3b7652 Mon Sep 17 00:00:00 2001 From: Benjamin Ssempala <86492979+BenjaminSsempala@users.noreply.github.com> Date: Thu, 13 Feb 2025 00:42:43 +0300 Subject: [PATCH] Move resource optimisation changes to Production --- k8s/analytics/values-prod.yaml | 18 +++-- k8s/analytics/values-stage.yaml | 3 - k8s/auth-service/values-prod.yaml | 18 +++-- k8s/calibrate/values-prod.yaml | 16 ++++- k8s/data-mgt/values-prod.yaml | 18 ++++- k8s/data-proxy/.helmignore | 22 ------- k8s/data-proxy/Chart.yaml | 10 --- k8s/data-proxy/charts/.gitkeep | 0 k8s/data-proxy/templates/NOTES.txt | 22 ------- k8s/data-proxy/templates/_helpers.tpl | 51 -------------- k8s/data-proxy/templates/deployment.yaml | 66 ------------------- k8s/data-proxy/templates/hpa.yaml | 31 --------- k8s/data-proxy/templates/service.yaml | 15 ----- .../templates/tests/test-connection.yaml | 15 ----- k8s/data-proxy/values-prod.yaml | 31 --------- k8s/data-proxy/values-stage.yaml | 31 --------- k8s/device-monitor/values-prod.yaml | 6 +- k8s/device-registry/values-prod.yaml | 18 ++++- k8s/incentives/values-prod.yaml | 20 ++++-- k8s/locate/values-prod.yaml | 17 ++++- k8s/locate/values-stage.yaml | 2 + k8s/meta-data/values-prod.yaml | 20 ++++-- k8s/predict/values-prod.yaml | 28 ++++---- k8s/spatial/values-prod.yaml | 16 ++++- k8s/view/values-prod.yaml | 36 +++++----- k8s/website/values-prod.yaml | 16 ++++- k8s/workflows/values-prod.yaml | 33 ++++++---- 27 files changed, 203 insertions(+), 376 deletions(-) delete mode 100644 k8s/data-proxy/.helmignore delete mode 100644 k8s/data-proxy/Chart.yaml delete mode 100644 k8s/data-proxy/charts/.gitkeep delete mode 100644 k8s/data-proxy/templates/NOTES.txt delete mode 100644 k8s/data-proxy/templates/_helpers.tpl delete mode 100644 k8s/data-proxy/templates/deployment.yaml delete mode 100644 k8s/data-proxy/templates/hpa.yaml delete mode 100644 k8s/data-proxy/templates/service.yaml delete mode 100644 k8s/data-proxy/templates/tests/test-connection.yaml delete mode 100644 k8s/data-proxy/values-prod.yaml delete mode 100644 k8s/data-proxy/values-stage.yaml diff --git a/k8s/analytics/values-prod.yaml b/k8s/analytics/values-prod.yaml index 61d35f210a..b71c259aa5 100644 --- a/k8s/analytics/values-prod.yaml +++ b/k8s/analytics/values-prod.yaml @@ -17,18 +17,26 @@ api: podAnnotations: {} resources: limits: - cpu: 1000m - memory: 2000Mi + cpu: 50m + memory: 1000Mi requests: cpu: 10m memory: 250Mi + + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - moderate-usage + weight: 1 jobs: reports: name: prod-analytics-report configmap: env-analytics-report-production - devicesSummaryJob: - name: analytics-devices-summary - configmap: env-analytics-production resources: limits: cpu: 1000m diff --git a/k8s/analytics/values-stage.yaml b/k8s/analytics/values-stage.yaml index 8985fb91d6..212f6d0e2a 100644 --- a/k8s/analytics/values-stage.yaml +++ b/k8s/analytics/values-stage.yaml @@ -38,9 +38,6 @@ jobs: reports: name: stage-analytics-report configmap: env-analytics-report-staging - devicesSummaryJob: - name: stage-analytics-devices-summary - configmap: env-analytics-staging resources: limits: cpu: 1000m diff --git a/k8s/auth-service/values-prod.yaml b/k8s/auth-service/values-prod.yaml index b8cbb24b2e..4e72b05ff1 100644 --- a/k8s/auth-service/values-prod.yaml +++ b/k8s/auth-service/values-prod.yaml @@ -12,11 +12,21 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 100m - memory: 350Mi + cpu: 400m + memory: 600Mi requests: - cpu: 10m + cpu: 50m memory: 250Mi +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - moderate-usage + weight: 1 volumeMounts: - name: config-volume mountPath: /etc/config @@ -35,4 +45,4 @@ service: autoscaling: minReplicas: 1 maxReplicas: 3 - targetMemoryUtilizationPercentage: 70 + targetMemoryUtilizationPercentage: 85 diff --git a/k8s/calibrate/values-prod.yaml b/k8s/calibrate/values-prod.yaml index 07e2a12011..374c2790e1 100644 --- a/k8s/calibrate/values-prod.yaml +++ b/k8s/calibrate/values-prod.yaml @@ -16,11 +16,21 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 100m - memory: 1500Mi + cpu: 700m + memory: 200Mi requests: cpu: 10m - memory: 950Mi + memory: 20Mi +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - high-mem + weight: 1 volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/k8s/data-mgt/values-prod.yaml b/k8s/data-mgt/values-prod.yaml index 013fc340ea..075d299a00 100644 --- a/k8s/data-mgt/values-prod.yaml +++ b/k8s/data-mgt/values-prod.yaml @@ -13,10 +13,22 @@ podAnnotations: {} resources: limits: cpu: 50m - memory: 500Mi + memory: 200Mi requests: - cpu: 10m - memory: 70Mi + cpu: 1m + memory: 100Mi +nodeSelector: + role: high-mem +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - high-mem + weight: 1 ingress: enabled: false service: diff --git a/k8s/data-proxy/.helmignore b/k8s/data-proxy/.helmignore deleted file mode 100644 index 50af031725..0000000000 --- a/k8s/data-proxy/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/k8s/data-proxy/Chart.yaml b/k8s/data-proxy/Chart.yaml deleted file mode 100644 index d57964bf03..0000000000 --- a/k8s/data-proxy/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: AirQo Data Proxy Helm Chart -name: data-proxy-api -home: https://airqo.net -version: 0.1.0 -maintainers: - - name: AirQo - email: support@airqo.net - url: https://airqo.net diff --git a/k8s/data-proxy/charts/.gitkeep b/k8s/data-proxy/charts/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/k8s/data-proxy/templates/NOTES.txt b/k8s/data-proxy/templates/NOTES.txt deleted file mode 100644 index 46a8ce21ab..0000000000 --- a/k8s/data-proxy/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "data-proxy-api.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "data-proxy-api.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "data-proxy-api.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "data-proxy-api.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/k8s/data-proxy/templates/_helpers.tpl b/k8s/data-proxy/templates/_helpers.tpl deleted file mode 100644 index 7894ec0c31..0000000000 --- a/k8s/data-proxy/templates/_helpers.tpl +++ /dev/null @@ -1,51 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "data-proxy-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "data-proxy-api.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "data-proxy-api.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "data-proxy-api.labels" -}} -helm.sh/chart: {{ include "data-proxy-api.chart" . }} -{{ include "data-proxy-api.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "data-proxy-api.selectorLabels" -}} -app.kubernetes.io/name: {{ include "data-proxy-api.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} \ No newline at end of file diff --git a/k8s/data-proxy/templates/deployment.yaml b/k8s/data-proxy/templates/deployment.yaml deleted file mode 100644 index 4bae155d02..0000000000 --- a/k8s/data-proxy/templates/deployment.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Values.app.name }} - namespace: {{ .Values.app.namespace }} - labels: - {{- include "data-proxy-api.labels" . | nindent 4 }} -spec: - selector: - matchLabels: - app: {{ .Values.app.label }} - replicas: {{ .Values.replicaCount }} - revisionHistoryLimit: 2 - strategy: - type: RollingUpdate - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - minReadySeconds: 5 - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - app: {{ .Values.app.label }} - spec: - affinity: - nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 10 - preference: - matchExpressions: - - key: node-type - operator: In - values: - - compute - - weight: 8 - preference: - matchExpressions: - - key: node-type - operator: In - values: - - high-memory - restartPolicy: Always - containers: - - name: {{ .Values.app.label }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: IfNotPresent - ports: - - containerPort: {{ .Values.service.targetPort }} - name: {{ .Values.app.label }} - envFrom: - - configMapRef: - name: {{ .Values.app.configmap }} - {{- with .Values.volumeMounts }} - volumeMounts: - {{- toYaml . | nindent 12 }} - {{- end }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.volumes }} - volumes: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/k8s/data-proxy/templates/hpa.yaml b/k8s/data-proxy/templates/hpa.yaml deleted file mode 100644 index 7dfcb588d1..0000000000 --- a/k8s/data-proxy/templates/hpa.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: '{{ .Values.app.name }}-hpa' - namespace: {{ .Values.app.namespace }} - labels: - {{- include "data-proxy-api.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ .Values.app.name }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} \ No newline at end of file diff --git a/k8s/data-proxy/templates/service.yaml b/k8s/data-proxy/templates/service.yaml deleted file mode 100644 index 6cd18026c3..0000000000 --- a/k8s/data-proxy/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: '{{ .Values.app.name }}-svc' - labels: {{- include "data-proxy-api.labels" . | nindent 4 }} - namespace: {{ .Values.app.namespace }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.targetPort }} - protocol: {{ .Values.service.protocol }} - nodePort: {{ .Values.service.nodePort }} - selector: - app: {{ .Values.app.label }} diff --git a/k8s/data-proxy/templates/tests/test-connection.yaml b/k8s/data-proxy/templates/tests/test-connection.yaml deleted file mode 100644 index bc8c18335f..0000000000 --- a/k8s/data-proxy/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "data-proxy-api.fullname" . }}-test-connection" - labels: -{{ include "data-proxy-api.labels" . | indent 4 }} - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "data-proxy-api.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never \ No newline at end of file diff --git a/k8s/data-proxy/values-prod.yaml b/k8s/data-proxy/values-prod.yaml deleted file mode 100644 index 0ee89935f6..0000000000 --- a/k8s/data-proxy/values-prod.yaml +++ /dev/null @@ -1,31 +0,0 @@ -app: - name: airqo-data-proxy-api - label: data-proxy-api - namespace: production - configmap: data-proxy-api-config -replicaCount: 2 -image: - repository: eu.gcr.io/airqo-250220/airqo-data-proxy-api - tag: prod-21e321a8-1730518961 -nameOverride: '' -fullnameOverride: '' -podAnnotations: {} -resources: - limits: - cpu: 50m - memory: 500Mi - requests: - cpu: 10m - memory: 70Mi -ingress: - enabled: false -service: - type: NodePort - port: 3000 - protocol: TCP - targetPort: 3000 - nodePort: 30015 -autoscaling: - minReplicas: 1 - maxReplicas: 3 - targetMemoryUtilizationPercentage: 70 diff --git a/k8s/data-proxy/values-stage.yaml b/k8s/data-proxy/values-stage.yaml deleted file mode 100644 index ce422dd3e4..0000000000 --- a/k8s/data-proxy/values-stage.yaml +++ /dev/null @@ -1,31 +0,0 @@ -app: - name: airqo-stage-data-proxy-api - label: sta-data-proxy - namespace: staging - configmap: data-proxy-api-config -replicaCount: 2 -image: - repository: eu.gcr.io/airqo-250220/airqo-stage-data-proxy-api - tag: stage-96d94ce4-1715349509 -nameOverride: '' -fullnameOverride: '' -podAnnotations: {} -resources: - limits: - cpu: 50m - memory: 100Mi - requests: - cpu: 5m - memory: 70Mi -ingress: - enabled: false -service: - type: NodePort - port: 3000 - protocol: TCP - targetPort: 3000 - nodePort: 31015 -autoscaling: - minReplicas: 1 - maxReplicas: 2 - targetMemoryUtilizationPercentage: 80 diff --git a/k8s/device-monitor/values-prod.yaml b/k8s/device-monitor/values-prod.yaml index 954b27a18c..1abc57ff7e 100644 --- a/k8s/device-monitor/values-prod.yaml +++ b/k8s/device-monitor/values-prod.yaml @@ -15,11 +15,13 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 500m + cpu: 50m memory: 1000Mi requests: cpu: 10m - memory: 50Mi + memory: 400Mi +nodeSelector: + role: high-mem volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/k8s/device-registry/values-prod.yaml b/k8s/device-registry/values-prod.yaml index 58eaf832c9..7e5446f13b 100644 --- a/k8s/device-registry/values-prod.yaml +++ b/k8s/device-registry/values-prod.yaml @@ -12,11 +12,23 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 600m - memory: 2000Mi + cpu: 200m + memory: 500Mi requests: cpu: 10m - memory: 600Mi + memory: 200Mi +nodeSelector: + role: moderate-usage +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - moderate-usage + weight: 1 volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/k8s/incentives/values-prod.yaml b/k8s/incentives/values-prod.yaml index 67cb211e85..be43227d0c 100644 --- a/k8s/incentives/values-prod.yaml +++ b/k8s/incentives/values-prod.yaml @@ -12,11 +12,23 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 1000m - memory: 500Mi - requests: cpu: 100m - memory: 250Mi + memory: 1000Mi + requests: + cpu: 10m + memory: 500Mi +nodeSelector: + role: high-mem +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - high-mem + weight: 1 ingress: enabled: false service: diff --git a/k8s/locate/values-prod.yaml b/k8s/locate/values-prod.yaml index 9c701e47fe..4e4790e5e1 100644 --- a/k8s/locate/values-prod.yaml +++ b/k8s/locate/values-prod.yaml @@ -12,11 +12,22 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 50m - memory: 500Mi + cpu: 150m + memory: 120Mi requests: cpu: 5m - memory: 300Mi + memory: 80Mi +nodeSelector: + role: moderate-usage +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: role + operator: In + values: + - moderate-usage ingress: enabled: false service: diff --git a/k8s/locate/values-stage.yaml b/k8s/locate/values-stage.yaml index cb59fe6622..082813e898 100644 --- a/k8s/locate/values-stage.yaml +++ b/k8s/locate/values-stage.yaml @@ -17,6 +17,8 @@ resources: requests: cpu: 5m memory: 80Mi +nodeSelector: + role: moderate-usage affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: diff --git a/k8s/meta-data/values-prod.yaml b/k8s/meta-data/values-prod.yaml index 8d721365e7..a160198a93 100644 --- a/k8s/meta-data/values-prod.yaml +++ b/k8s/meta-data/values-prod.yaml @@ -14,11 +14,23 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 1000m - memory: 500Mi + cpu: 300m + memory: 700Mi requests: - cpu: 100m - memory: 250Mi + cpu: 10m + memory: 300Mi +nodeSelector: + role: high-mem +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - high-mem + weight: 1 volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/k8s/predict/values-prod.yaml b/k8s/predict/values-prod.yaml index 03d5ea4333..88327f1fb4 100644 --- a/k8s/predict/values-prod.yaml +++ b/k8s/predict/values-prod.yaml @@ -16,23 +16,23 @@ api: podAnnotations: {} resources: limits: - cpu: 100m + cpu: 50m memory: 400Mi requests: cpu: 5m - memory: 120Mi -jobs: - predictPlaces: - name: airqo-predict-places-air-quality - configmap: env-predict-places-air-quality-production - schedule: 0 * * * * - resources: - limits: - cpu: 8000m - memory: 16000Mi - requests: - cpu: 2500m - memory: 4000Mi + memory: 150Mi + nodeSelector: + role: moderate-usage + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - moderate-usage + weight: 1 volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/k8s/spatial/values-prod.yaml b/k8s/spatial/values-prod.yaml index c05d9a4257..8f4dc7f281 100644 --- a/k8s/spatial/values-prod.yaml +++ b/k8s/spatial/values-prod.yaml @@ -12,11 +12,23 @@ fullnameOverride: '' podAnnotations: {} resources: limits: - cpu: 100m - memory: 350Mi + cpu: 200m + memory: 500Mi requests: cpu: 10m memory: 250Mi +nodeSelector: + role: high-cpu +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - high-cpu + weight: 1 volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/k8s/view/values-prod.yaml b/k8s/view/values-prod.yaml index 4e5a9a6179..904d9daebd 100644 --- a/k8s/view/values-prod.yaml +++ b/k8s/view/values-prod.yaml @@ -14,25 +14,23 @@ api: podAnnotations: {} resources: limits: - cpu: 100m - memory: 1500Mi + cpu: 20m + memory: 420Mi requests: - cpu: 10m - memory: 500Mi -messageBroker: - name: airqo-view-message-broker - label: view-msg-brokr - configmap: prod-view-message-broker-config - replicaCount: 2 - podAnnotations: - sidecar.istio.io/inject: 'false' - resources: - limits: - cpu: 500m - memory: 800Mi - requests: - cpu: 50m - memory: 400Mi + cpu: 5m + memory: 300Mi + nodeSelector: + role: high-mem + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - high-mem + weight: 1 ingress: enabled: false service: @@ -43,4 +41,4 @@ service: autoscaling: minReplicas: 1 maxReplicas: 2 - targetCPUUtilizationPercentage: 70 + targetCPUUtilizationPercentage: 80 diff --git a/k8s/website/values-prod.yaml b/k8s/website/values-prod.yaml index 210379fda7..eb8c0202e6 100644 --- a/k8s/website/values-prod.yaml +++ b/k8s/website/values-prod.yaml @@ -13,10 +13,22 @@ podAnnotations: {} resources: limits: cpu: 100m - memory: 350Mi + memory: 600Mi requests: cpu: 10m - memory: 250Mi + memory: 300Mi +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: role + operator: In + values: + - control-plane + weight: 1 +nodeSelector: + role: control-plane volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/k8s/workflows/values-prod.yaml b/k8s/workflows/values-prod.yaml index 3613ae3bb8..c3d35df478 100644 --- a/k8s/workflows/values-prod.yaml +++ b/k8s/workflows/values-prod.yaml @@ -17,32 +17,43 @@ podAnnotations: {} resources: webserver: requests: - cpu: 500m - memory: 500Mi + cpu: 125m + memory: 1000Mi limits: - cpu: 1500m + cpu: 500m memory: 2000Mi scheduler: requests: - cpu: 125m - memory: 500Mi + cpu: 500m + memory: 1000Mi limits: - cpu: 1000m - memory: 3000Mi + cpu: 3000m + memory: 1800Mi celery: requests: cpu: 125m - memory: 2565Mi + memory: 500Mi limits: cpu: 3000m memory: 4000Mi redis: requests: cpu: 50m - memory: 125Mi + memory: 10Mi limits: - cpu: 1000m - memory: 3000Mi + cpu: 300m + memory: 50Mi +nodeSelector: + role: high-cpu +affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: role + operator: In + values: + - high-cpu volumeMounts: - name: config-volume mountPath: /etc/config