feat(helm): support different replicaCount (#20883)

* feat(helm): bump chart version

* feat(helm): add separate replicaCount for superset node / worker

* docs: update documentation

* ref(helm): add replicaCount with condition

* ref(helm): edit condition

* ref(helm): enclose replica with if/else

* ref(helm): remove specific replicaCount in values

* revert: "docs: update documentation"

This reverts commit 6ab95a71a2df267e9e1f16ec0ca03b014006aa2c.

* fix(helm): fix typo

* ref(helm): replace condition with default value

* ref(helm): replace replicaCount with per-component replicaCount

Co-authored-by: Gabriel Forien <gforien.externe@bedrockstreaming.com>
diff --git a/docs/docs/installation/running-on-kubernetes.mdx b/docs/docs/installation/running-on-kubernetes.mdx
index 755172a..f7e568e 100644
--- a/docs/docs/installation/running-on-kubernetes.mdx
+++ b/docs/docs/installation/running-on-kubernetes.mdx
@@ -63,7 +63,7 @@
 
 The exact list will depend on some of your specific configuration overrides but you should generally expect:
 
-- N `superset-xxxx-yyyy` and `superset-worker-xxxx-yyyy` pods (depending on your `replicaCount` value)
+- N `superset-xxxx-yyyy` and `superset-worker-xxxx-yyyy` pods (depending on your `supersetNode.replicaCount` and `supersetWorker.replicaCount` values)
 - 1 `superset-postgresql-0` depending on your postgres settings
 - 1 `superset-redis-master-0` depending on your redis settings
 - 1 `superset-celerybeat-xxxx-yyyy` pod if you have `supersetCeleryBeat.enabled = true` in your values overrides
diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml
index e22bc96..078d11b 100644
--- a/helm/superset/Chart.yaml
+++ b/helm/superset/Chart.yaml
@@ -22,7 +22,7 @@
   - name: craig-rueda
     email: craig@craigrueda.com
     url: https://github.com/craig-rueda
-version: 0.6.6
+version: 0.7.0
 dependencies:
 - name: postgresql
   version: 11.1.22
diff --git a/helm/superset/templates/deployment-worker.yaml b/helm/superset/templates/deployment-worker.yaml
index 2d2cb0d..71f90ac 100644
--- a/helm/superset/templates/deployment-worker.yaml
+++ b/helm/superset/templates/deployment-worker.yaml
@@ -28,7 +28,7 @@
     {{ toYaml .Values.supersetWorker.deploymentAnnotations | nindent 4 }}
 {{- end }}
 spec:
-  replicas: {{ .Values.replicaCount }}
+  replicas: {{ .Values.supersetWorker.replicaCount }}
   selector:
     matchLabels:
       app: {{ template "superset.name" . }}-worker
diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml
index 75156d8..8d035a2 100644
--- a/helm/superset/templates/deployment.yaml
+++ b/helm/superset/templates/deployment.yaml
@@ -28,7 +28,7 @@
     {{ toYaml .Values.supersetNode.deploymentAnnotations | nindent 4 }}
 {{- end }}
 spec:
-  replicas: {{ .Values.replicaCount }}
+  replicas: {{ .Values.supersetNode.replicaCount }}
   selector:
     matchLabels:
       app: {{ template "superset.name" . }}
diff --git a/helm/superset/values.schema.json b/helm/superset/values.schema.json
index 33912c6..dc8a586 100644
--- a/helm/superset/values.schema.json
+++ b/helm/superset/values.schema.json
@@ -3,9 +3,6 @@
     "type": "object",
     "additionalProperties": true,
     "properties": {
-        "replicaCount": {
-            "type": "integer"
-        },
         "runAsUser": {
             "type": "integer"
         },
@@ -216,6 +213,9 @@
             "type": "object",
             "additionalProperties": false,
             "properties": {
+                "replicaCount": {
+                    "type": "integer"
+                },
                 "command": {
                     "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/command"
                 },
@@ -287,6 +287,7 @@
                 }
             },
             "required": [
+                "replicaCount",
                 "command",
                 "connections",
                 "env",
@@ -297,6 +298,9 @@
             "type": "object",
             "additionalProperties": false,
             "properties": {
+                "replicaCount": {
+                    "type": "integer"
+                },
                 "command": {
                     "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/command"
                 },
@@ -326,6 +330,7 @@
                 }
             },
             "required": [
+                "replicaCount",
                 "command",
                 "forceReload"
             ]
@@ -594,7 +599,6 @@
         }
     },
     "required": [
-        "replicaCount",
         "runAsUser",
         "serviceAccount",
         "bootstrapScript",
diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml
index 1b2fe3a..3188903 100644
--- a/helm/superset/values.yaml
+++ b/helm/superset/values.yaml
@@ -19,8 +19,6 @@
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
-replicaCount: 1
-
 # User ID directive. This user must have enough permissions to run the bootstrap script
 # Runn containers as root is not recommended in production. Change this to another UID - e.g. 1000 to be more secure
 runAsUser: 0
@@ -224,6 +222,7 @@
 ##
 ## Superset node configuration
 supersetNode:
+  replicaCount: 1
   command:
     - "/bin/sh"
     - "-c"
@@ -268,6 +267,7 @@
 ##
 ## Superset worker configuration
 supersetWorker:
+  replicaCount: 1
   command:
     - "/bin/sh"
     - "-c"