Skip to content

Commit

Permalink
feat(Helm Chart): Support resource limits and requests for each compo…
Browse files Browse the repository at this point in the history
…nent (#20052)
  • Loading branch information
rathberm committed May 25, 2022
1 parent 4674de1 commit 259e03e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions helm/superset/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
9 changes: 9 additions & 0 deletions helm/superset/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down
26 changes: 26 additions & 0 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 259e03e

Please sign in to comment.