diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 8af3ae4acf579..729a5114c39db 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -29,7 +29,7 @@ maintainers: - name: craig-rueda email: craig@craigrueda.com url: https://github.com/craig-rueda -version: 0.10.6 +version: 0.10.7 dependencies: - name: postgresql version: 12.1.6 diff --git a/helm/superset/README.md b/helm/superset/README.md index 724eb4310160d..1b2588cbc2b7b 100644 --- a/helm/superset/README.md +++ b/helm/superset/README.md @@ -23,7 +23,7 @@ NOTE: This file is generated by helm-docs: https://github.com/norwoodj/helm-docs # superset -![Version: 0.10.6](https://img.shields.io/badge/Version-0.10.6-informational?style=flat-square) +![Version: 0.10.7](https://img.shields.io/badge/Version-0.10.7-informational?style=flat-square) Apache Superset is a modern, enterprise-ready business intelligence web application @@ -169,6 +169,10 @@ helm install my-superset superset/superset | supersetCeleryFlower.startupProbe.timeoutSeconds | int | `1` | | | supersetCeleryFlower.topologySpreadConstraints | list | `[]` | TopologySpreadConstrains to be added to supersetCeleryFlower deployments | | supersetNode.affinity | object | `{}` | Affinity to be added to supersetNode deployment | +| supersetNode.autoscaling.enabled | bool | `false` | | +| supersetNode.autoscaling.maxReplicas | int | `100` | | +| supersetNode.autoscaling.minReplicas | int | `1` | | +| supersetNode.autoscaling.targetCPUUtilizationPercentage | int | `80` | | | supersetNode.command | list | See `values.yaml` | Startup command | | supersetNode.connections.db_host | string | `"{{ .Release.Name }}-postgresql"` | | | supersetNode.connections.db_name | string | `"superset"` | | @@ -257,6 +261,10 @@ helm install my-superset superset/superset | supersetWebsockets.strategy | object | `{}` | | | supersetWebsockets.topologySpreadConstraints | list | `[]` | TopologySpreadConstrains to be added to supersetWebsockets deployments | | supersetWorker.affinity | object | `{}` | Affinity to be added to supersetWorker deployment | +| supersetWorker.autoscaling.enabled | bool | `false` | | +| supersetWorker.autoscaling.maxReplicas | int | `100` | | +| supersetWorker.autoscaling.minReplicas | int | `1` | | +| supersetWorker.autoscaling.targetCPUUtilizationPercentage | int | `80` | | | supersetWorker.command | list | a `celery worker` command | Worker startup command | | supersetWorker.containerSecurityContext | object | `{}` | | | supersetWorker.deploymentAnnotations | object | `{}` | Annotations to be added to supersetWorker deployment | diff --git a/helm/superset/templates/deployment-worker.yaml b/helm/superset/templates/deployment-worker.yaml index 7f2bcf8df3cd5..d84e7e9561103 100644 --- a/helm/superset/templates/deployment-worker.yaml +++ b/helm/superset/templates/deployment-worker.yaml @@ -34,7 +34,9 @@ metadata: annotations: {{- toYaml .Values.supersetWorker.deploymentAnnotations | nindent 4 }} {{- end }} spec: + {{- if not .Values.supersetWorker.autoscaling.enabled }} replicas: {{ .Values.supersetWorker.replicaCount }} + {{- end }} selector: matchLabels: app: {{ template "superset.name" . }}-worker diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml index 780ae87963c7d..19a32d7069c5d 100644 --- a/helm/superset/templates/deployment.yaml +++ b/helm/superset/templates/deployment.yaml @@ -34,7 +34,9 @@ metadata: annotations: {{- toYaml .Values.supersetNode.deploymentAnnotations | nindent 4 }} {{- end }} spec: + {{- if not .Values.supersetNode.autoscaling.enabled }} replicas: {{ .Values.supersetNode.replicaCount }} + {{- end }} {{- if .Values.supersetNode.strategy }} strategy: {{- toYaml .Values.supersetNode.strategy | nindent 4 }} {{- end }} diff --git a/helm/superset/templates/hpa-node.yaml b/helm/superset/templates/hpa-node.yaml new file mode 100644 index 0000000000000..aee2d1da78fd8 --- /dev/null +++ b/helm/superset/templates/hpa-node.yaml @@ -0,0 +1,54 @@ +{{/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/}} + +{{- if .Values.supersetNode.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "superset.fullname" . }}-hpa + labels: + app: {{ template "superset.name" . }} + chart: {{ template "superset.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "superset.fullname" . }} + minReplicas: {{ .Values.supersetNode.autoscaling.minReplicas }} + maxReplicas: {{ .Values.supersetNode.autoscaling.maxReplicas }} + metrics: + {{- if .Values.supersetNode.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.supersetNode.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.supersetNode.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.supersetNode.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/superset/templates/hpa-worker.yaml b/helm/superset/templates/hpa-worker.yaml new file mode 100644 index 0000000000000..f2fd2154a46a4 --- /dev/null +++ b/helm/superset/templates/hpa-worker.yaml @@ -0,0 +1,54 @@ +{{/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/}} + +{{- if .Values.supersetWorker.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "superset.fullname" . }}-hpa-worker + labels: + app: {{ template "superset.name" . }} + chart: {{ template "superset.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "superset.fullname" . }}-worker + minReplicas: {{ .Values.supersetWorker.autoscaling.minReplicas }} + maxReplicas: {{ .Values.supersetWorker.autoscaling.maxReplicas }} + metrics: + {{- if .Values.supersetWorker.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.supersetWorker.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.supersetWorker.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.supersetWorker.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 660aac8af5329..921033dc47c24 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -240,6 +240,13 @@ hostAliases: [] # Superset node configuration supersetNode: replicaCount: 1 + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + # -- Startup command # @default -- See `values.yaml` command: @@ -334,6 +341,13 @@ supersetNode: # Superset Celery worker configuration supersetWorker: replicaCount: 1 + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + # -- Worker startup command # @default -- a `celery worker` command command: