Skip to content

Commit fa3fc71

Browse files
authored
feat: allow specifying deployment in helm chart without autoscaling (#41397)
## Description Allows specifying that the deployment of Appsmith should be done via the Deployment controller without enabling autoscaling. This is useful in situations where you want to be able to set a number of replicas without using HPAs or if you want the flexibility to set replica count to 0 to temporarily pause the instance. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!WARNING] > Tests have not run on the HEAD 35fba39 yet > <hr>Wed, 19 Nov 2025 03:42:56 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Choice of workload type (Deployment or StatefulSet) and replicas behavior when using Deployment * Persistent storage now can be provisioned for Deployment workloads as well as StatefulSets * **Documentation** * Added guidance on workload kind, replicas usage, and interaction with autoscaling * **Tests** * Added tests covering persistence and workload-kind rendering scenarios * **Chores** * Chart version bumped to 3.6.6 <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 5fe86c8 commit fa3fc71

9 files changed

Lines changed: 137 additions & 16 deletions

File tree

deploy/helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sources:
1111
- https://github.com/appsmithorg/appsmith
1212
home: https://www.appsmith.com/
1313
icon: https://assets.appsmith.com/appsmith-icon.png
14-
version: 3.6.5
14+
version: 3.6.6
1515
dependencies:
1616
- condition: redis.enabled
1717
name: redis

deploy/helm/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ The command uninstalls the release and removes all Kubernetes resources associat
9696
| `tolerations` | Tolerations for pod assignment | `[]` |
9797
| `affinity` | Affinity fod pod assignment | `{}` |
9898

99+
#### Workload kind
100+
101+
- `workload.kind`: Selects the workload resource to create. Allowed values: `Deployment`, `StatefulSet` (case-insensitive; default: `StatefulSet`).
102+
- Note: When `autoscaling.enabled` is `true`, `workload.kind` is ignored and a `Deployment` is used.
103+
- When using `Deployment` without autoscaling, control the number of replicas with `replicas`.
104+
99105
### Appsmith service account parameters
100106
| Name | Description | Value |
101107
| ----------------------------- | ----------------------------------------------------------------------------------------------------------- | ------- |

deploy/helm/templates/deployment.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
{{- $updateStrategy := .Values.updateStrategy | default dict }}
22
{{- $postgresuser := .Values.postgresql.auth.username }}
33
{{- $postgrespass := .Values.postgresql.auth.password }}
4-
{{- $postgrespass := .Values.postgresql.auth.password }}
54
{{- $releaseName := include "appsmith.fullname" . -}}
5+
{{- $workloadKind := upper (toString .Values.workload.kind) -}}
6+
{{- $useDeployment := or (eq $workloadKind "DEPLOYMENT") .Values.autoscaling.enabled }}
67
apiVersion: apps/v1
7-
kind: {{ if not .Values.autoscaling.enabled }}StatefulSet{{- else }}Deployment{{- end }}
8+
kind: {{ if $useDeployment }}Deployment{{- else }}StatefulSet{{- end }}
89
metadata:
910
name: {{ include "appsmith.fullname" . }}
1011
namespace: {{ include "appsmith.namespace" . }}
1112
labels:
1213
{{- include "appsmith.labels" . | nindent 4 }}
1314
spec:
15+
{{- if $useDeployment }}
1416
{{- if not .Values.autoscaling.enabled }}
15-
replicas: 1
16-
serviceName: {{ include "appsmith.fullname" . }}
17-
updateStrategy:
18-
{{- else }}
17+
replicas: {{ .Values.replicas | default 1 }}
18+
{{- end }}
1919
strategy:
2020
type: {{ .Values.strategyType | default "RollingUpdate" }}
2121
rollingUpdate:
2222
maxSurge: {{ dig "maxSurge" 1 $updateStrategy }}
2323
maxUnavailable: {{ dig "maxUnavailable" "0" $updateStrategy }}
24+
{{- else }}
25+
replicas: 1
26+
serviceName: {{ include "appsmith.fullname" . }}
2427
{{- end }}
2528
selector:
2629
matchLabels:
@@ -182,7 +185,7 @@ spec:
182185
{{- if not .Values.persistence.enabled }}
183186
- name: data
184187
emptyDir: {}
185-
{{- else if and (not .Values.autoscaling.enabled) (.Values.persistence.enabled) }}
188+
{{- else if and (not $useDeployment) (.Values.persistence.enabled) }}
186189
volumeClaimTemplates:
187190
- metadata:
188191
name: data

deploy/helm/templates/persistentVolume.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) ( .Values.autoscaling.enabled) }}
1+
{{- $workloadKind := upper (toString .Values.workload.kind) -}}
2+
{{- $useDeployment := or (eq $workloadKind "DEPLOYMENT") .Values.autoscaling.enabled }}
3+
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) $useDeployment }}
24
apiVersion: v1
35
kind: PersistentVolume
46
metadata:

deploy/helm/templates/persistentVolumeClaim.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) ( .Values.autoscaling.enabled) }}
1+
{{- $workloadKind := upper (toString .Values.workload.kind) -}}
2+
{{- $useDeployment := or (eq $workloadKind "DEPLOYMENT") .Values.autoscaling.enabled }}
3+
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) $useDeployment }}
24
kind: PersistentVolumeClaim
35
apiVersion: v1
46
metadata:

deploy/helm/tests/__snapshot__/defaults_snapshot_test.yaml.snap

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
app.kubernetes.io/instance: RELEASE-NAME
2626
app.kubernetes.io/managed-by: Helm
2727
app.kubernetes.io/name: appsmith
28-
appsmith.sh/chart: appsmith-3.6.5
28+
appsmith.sh/chart: appsmith-3.6.6
2929
name: RELEASE-NAME-appsmith
3030
namespace: NAMESPACE
3131
3: |
@@ -36,7 +36,7 @@
3636
app.kubernetes.io/instance: RELEASE-NAME
3737
app.kubernetes.io/managed-by: Helm
3838
app.kubernetes.io/name: appsmith
39-
appsmith.sh/chart: appsmith-3.6.5
39+
appsmith.sh/chart: appsmith-3.6.6
4040
name: RELEASE-NAME-appsmith
4141
namespace: NAMESPACE
4242
spec:
@@ -125,7 +125,6 @@
125125
securityContext: {}
126126
serviceAccountName: RELEASE-NAME-appsmith
127127
volumes: null
128-
updateStrategy: null
129128
volumeClaimTemplates:
130129
- metadata:
131130
name: data
@@ -143,7 +142,7 @@
143142
app.kubernetes.io/instance: RELEASE-NAME
144143
app.kubernetes.io/managed-by: Helm
145144
app.kubernetes.io/name: appsmith
146-
appsmith.sh/chart: appsmith-3.6.5
145+
appsmith.sh/chart: appsmith-3.6.6
147146
name: RELEASE-NAME-appsmith-headless
148147
namespace: NAMESPACE
149148
spec:
@@ -182,7 +181,7 @@
182181
app.kubernetes.io/instance: RELEASE-NAME
183182
app.kubernetes.io/managed-by: Helm
184183
app.kubernetes.io/name: appsmith
185-
appsmith.sh/chart: appsmith-3.6.5
184+
appsmith.sh/chart: appsmith-3.6.6
186185
name: RELEASE-NAME-appsmith
187186
namespace: NAMESPACE
188187
spec:
@@ -203,7 +202,7 @@
203202
app.kubernetes.io/instance: RELEASE-NAME
204203
app.kubernetes.io/managed-by: Helm
205204
app.kubernetes.io/name: appsmith
206-
appsmith.sh/chart: appsmith-3.6.5
205+
appsmith.sh/chart: appsmith-3.6.6
207206
name: RELEASE-NAME-appsmith
208207
namespace: NAMESPACE
209208
secrets:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
templates:
2+
- persistentVolume.yaml
3+
- persistentVolumeClaim.yaml
4+
tests:
5+
# Test PersistentVolume creation
6+
- name: PV and PVC should be created when persistence enabled, no existing claim, and autoscaling enabled
7+
set:
8+
persistence:
9+
enabled: true
10+
existingClaim:
11+
enabled: false
12+
autoscaling:
13+
enabled: true
14+
asserts:
15+
- isKind:
16+
of: PersistentVolumeClaim
17+
template: persistentVolumeClaim.yaml
18+
- isKind:
19+
of: PersistentVolume
20+
template: persistentVolume.yaml
21+
22+
- name: PVC should NOT be created when persistence is disabled
23+
set:
24+
persistence:
25+
enabled: false
26+
existingClaim:
27+
enabled: false
28+
autoscaling:
29+
enabled: true
30+
asserts:
31+
- hasDocuments:
32+
count: 0
33+
34+
- name: PV and PVC should not be created when using existing claim
35+
set:
36+
persistence:
37+
enabled: true
38+
existingClaim:
39+
enabled: true
40+
autoscaling:
41+
enabled: true
42+
asserts:
43+
- hasDocuments:
44+
count: 0
45+
46+
- name: PV and PVC should be created when setting workload kind to Deployment
47+
set:
48+
workload:
49+
kind: Deployment
50+
asserts:
51+
- isKind:
52+
of: PersistentVolumeClaim
53+
template: persistentVolumeClaim.yaml
54+
- isKind:
55+
of: PersistentVolume
56+
template: persistentVolume.yaml
57+
58+
- name: PV and PVC should not be created when autoscaling is disabled and workload kind not set
59+
set:
60+
autoscaling:
61+
enabled: false
62+
asserts:
63+
- hasDocuments:
64+
count: 0
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
templates:
2+
- deployment.yaml
3+
tests:
4+
- name: workload type should be StatefulSet when not set
5+
asserts:
6+
- equal:
7+
path: kind
8+
value: StatefulSet
9+
- name: workload type should be Deployment when set
10+
set:
11+
workload:
12+
kind: Deployment
13+
asserts:
14+
- equal:
15+
path: kind
16+
value: Deployment
17+
- name: replica count should be used when set
18+
set:
19+
workload:
20+
kind: Deployment
21+
replicas: 99
22+
asserts:
23+
- equal:
24+
path: spec.replicas
25+
value: 99
26+
- name: workload type should be Deployment when autoscaling is enabled
27+
set:
28+
autoscaling:
29+
enabled: true
30+
asserts:
31+
- equal:
32+
path: kind
33+
value: Deployment

deploy/helm/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,18 @@ resources:
271271
cpu: 500m
272272
memory: 3000Mi
273273

274+
## @param workload.kind Select workload resource type: Deployment or StatefulSet
275+
## When set to Deployment, the chart creates a Deployment instead of a StatefulSet.
276+
## Note: This value is ignored when autoscaling.enabled is true (Deployment is used).
277+
##
278+
workload:
279+
kind: StatefulSet
280+
281+
## @param replicas Number of replicas when autoscaling is disabled
282+
## Only used when workload.kind is Deployment and autoscaling.enabled is false
283+
##
284+
replicas: 1
285+
274286
autoscaling:
275287
enabled: false
276288
minReplicas: 2

0 commit comments

Comments
 (0)