From db6f7bd5c9d893cffc688ebd851f75fc045acdcd Mon Sep 17 00:00:00 2001 From: sriniarul Date: Mon, 19 Feb 2024 22:27:04 +0530 Subject: [PATCH 1/2] scheduler and webservice with custom resource enhancement --- charts/mageai/templates/scheduler.yaml | 2 +- charts/mageai/templates/webservice.yaml | 2 +- charts/mageai/values.yaml | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/charts/mageai/templates/scheduler.yaml b/charts/mageai/templates/scheduler.yaml index 0c39fe3..c8c63f0 100644 --- a/charts/mageai/templates/scheduler.yaml +++ b/charts/mageai/templates/scheduler.yaml @@ -51,7 +51,7 @@ spec: containerPort: {{ .Values.service.port }} protocol: TCP resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.scheduler.resources | nindent 12 }} envFrom: {{- if .Values.config }} - configMapRef: diff --git a/charts/mageai/templates/webservice.yaml b/charts/mageai/templates/webservice.yaml index 02d5556..0337413 100644 --- a/charts/mageai/templates/webservice.yaml +++ b/charts/mageai/templates/webservice.yaml @@ -79,7 +79,7 @@ spec: timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} {{- end }} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.webServer.resources | nindent 12 }} envFrom: {{- if .Values.config }} - configMapRef: diff --git a/charts/mageai/values.yaml b/charts/mageai/values.yaml index f550c92..89ff991 100644 --- a/charts/mageai/values.yaml +++ b/charts/mageai/values.yaml @@ -9,12 +9,34 @@ standaloneScheduler: false scheduler: replicaCount: 1 name: mageai-scheduler + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi # Effective if standaloneScheduler is true webServer: replicaCount: 1 name: mageai-webserver + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi # Enable redis if you want more replica redis: From e176d245b8994c68e469b8d5ae2a19bcb6744a9c Mon Sep 17 00:00:00 2001 From: Arulsrinivaasan Date: Wed, 27 Mar 2024 20:51:39 +0530 Subject: [PATCH 2/2] resource configurations fallback support resource configurations fallback support --- charts/mageai/templates/scheduler.yaml | 6 +++++- charts/mageai/templates/webservice.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/mageai/templates/scheduler.yaml b/charts/mageai/templates/scheduler.yaml index c8c63f0..54b8f45 100644 --- a/charts/mageai/templates/scheduler.yaml +++ b/charts/mageai/templates/scheduler.yaml @@ -51,7 +51,11 @@ spec: containerPort: {{ .Values.service.port }} protocol: TCP resources: - {{- toYaml .Values.scheduler.resources | nindent 12 }} + {{- if .Values.scheduler.resources }} + {{- toYaml .Values.scheduler.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} envFrom: {{- if .Values.config }} - configMapRef: diff --git a/charts/mageai/templates/webservice.yaml b/charts/mageai/templates/webservice.yaml index 0337413..ee6f990 100644 --- a/charts/mageai/templates/webservice.yaml +++ b/charts/mageai/templates/webservice.yaml @@ -79,7 +79,11 @@ spec: timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} {{- end }} resources: - {{- toYaml .Values.webServer.resources | nindent 12 }} + {{- if .Values.webServer.resources }} + {{- toYaml .Values.webServer.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} envFrom: {{- if .Values.config }} - configMapRef: