From 9267f42aab868ca2cdea47b15b2f27370c583588 Mon Sep 17 00:00:00 2001 From: Moritz Rathberger <46812235+rathberm@users.noreply.github.com> Date: Wed, 25 May 2022 17:49:56 +0200 Subject: [PATCH] feat(Helm Chart): Support resource limits and requests for each component (#20052) --- helm/superset/Chart.yaml | 2 +- helm/superset/templates/deployment-beat.yaml | 4 +++ .../superset/templates/deployment-worker.yaml | 4 +++ helm/superset/templates/deployment.yaml | 4 +++ helm/superset/values.schema.json | 9 +++++++ helm/superset/values.yaml | 26 +++++++++++++++++++ 6 files changed, 48 insertions(+), 1 deletion(-) diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 8d93ab473195..70dd6fd162b8 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -22,7 +22,7 @@ maintainers: - name: craig-rueda email: craig@craigrueda.com url: https://github.com/craig-rueda -version: 0.6.1 +version: 0.6.2 dependencies: - name: postgresql version: 11.1.22 diff --git a/helm/superset/templates/deployment-beat.yaml b/helm/superset/templates/deployment-beat.yaml index 55223defc642..d46d47ee3f9c 100644 --- a/helm/superset/templates/deployment-beat.yaml +++ b/helm/superset/templates/deployment-beat.yaml @@ -98,7 +98,11 @@ spec: {{- tpl (toYaml .) $ | nindent 12 -}} {{- end }} resources: + {{- if .Values.supersetCeleryBeat.resources }} +{{ toYaml .Values.supersetCeleryBeat.resources | indent 12 }} + {{- else }} {{ toYaml .Values.resources | indent 12 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} diff --git a/helm/superset/templates/deployment-worker.yaml b/helm/superset/templates/deployment-worker.yaml index 07bacd371b77..54eb5d87517e 100644 --- a/helm/superset/templates/deployment-worker.yaml +++ b/helm/superset/templates/deployment-worker.yaml @@ -99,7 +99,11 @@ spec: {{- tpl (toYaml .) $ | nindent 12 -}} {{- end }} resources: + {{- if .Values.supersetWorker.resources }} +{{ toYaml .Values.supersetWorker.resources | indent 12 }} + {{- else }} {{ toYaml .Values.resources | indent 12 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml index b760d5454da2..4d3a42e8e20a 100644 --- a/helm/superset/templates/deployment.yaml +++ b/helm/superset/templates/deployment.yaml @@ -115,7 +115,11 @@ spec: containerPort: {{ .Values.service.port }} protocol: TCP resources: + {{- if .Values.supersetNode.resources }} +{{ toYaml .Values.supersetNode.resources | indent 12 }} + {{- else }} {{ toYaml .Values.resources | indent 12 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} diff --git a/helm/superset/values.schema.json b/helm/superset/values.schema.json index 5e419d35a67d..6c4359a0ff94 100644 --- a/helm/superset/values.schema.json +++ b/helm/superset/values.schema.json @@ -275,6 +275,9 @@ }, "podLabels": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels" + }, + "resources": { + "type": "object" } }, "required": [ @@ -305,6 +308,9 @@ }, "podLabels": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels" + }, + "resources": { + "type": "object" } }, "required": [ @@ -336,6 +342,9 @@ }, "podLabels": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels" + }, + "resources": { + "type": "object" } }, "required": [ diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 2adc6bf66294..197ec4b3c6e7 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -203,6 +203,8 @@ resources: {} # 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:'. + # The limits below will apply to all Superset components. To set individual resource limitations refer to the pod specific values below. + # The pod specific values will overwrite anything that is set here. # limits: # cpu: 100m # memory: 128Mi @@ -253,6 +255,14 @@ supersetNode: podAnnotations: {} ## Labels to be added to supersetNode pods podLabels: {} + # Resource settings for the supersetNode pods - these settings overwrite might existing values from the global resources object defined above. + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi ## ## Superset worker configuration supersetWorker: @@ -275,6 +285,14 @@ supersetWorker: podAnnotations: {} ## Labels to be added to supersetWorker pods podLabels: {} + # Resource settings for the supersetWorker pods - these settings overwrite might existing values from the global resources object defined above. + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi ## ## Superset beat configuration (to trigger scheduled jobs like reports) supersetCeleryBeat: @@ -299,6 +317,14 @@ supersetCeleryBeat: podAnnotations: {} ## Labels to be added to supersetCeleryBeat pods podLabels: {} + # Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi ## ## Init job configuration init: