Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sources:
- https://github.com/appsmithorg/appsmith
home: https://www.appsmith.com/
icon: https://assets.appsmith.com/appsmith-icon.png
version: 3.6.5
version: 3.6.6
dependencies:
- condition: redis.enabled
name: redis
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ The command uninstalls the release and removes all Kubernetes resources associat
| `tolerations` | Tolerations for pod assignment | `[]` |
| `affinity` | Affinity fod pod assignment | `{}` |

#### Workload kind

- `workload.kind`: Selects the workload resource to create. Allowed values: `Deployment`, `StatefulSet` (case-insensitive; default: `StatefulSet`).
- Note: When `autoscaling.enabled` is `true`, `workload.kind` is ignored and a `Deployment` is used.
- When using `Deployment` without autoscaling, control the number of replicas with `replicas`.

### Appsmith service account parameters
| Name | Description | Value |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------- | ------- |
Expand Down
18 changes: 11 additions & 7 deletions deploy/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
{{- $updateStrategy := .Values.updateStrategy | default dict }}
{{- $postgresuser := .Values.postgresql.auth.username }}
{{- $postgrespass := .Values.postgresql.auth.password }}
{{- $postgrespass := .Values.postgresql.auth.password }}
{{- $releaseName := include "appsmith.fullname" . -}}
{{- $workloadKind := upper (toString .Values.workload.kind) -}}
{{- $useDeployment := or (eq $workloadKind "DEPLOYMENT") .Values.autoscaling.enabled }}
apiVersion: apps/v1
kind: {{ if not .Values.autoscaling.enabled }}StatefulSet{{- else }}Deployment{{- end }}
kind: {{ if $useDeployment }}Deployment{{- else }}StatefulSet{{- end }}
metadata:
name: {{ include "appsmith.fullname" . }}
namespace: {{ include "appsmith.namespace" . }}
labels:
{{- include "appsmith.labels" . | nindent 4 }}
spec:
{{- if $useDeployment }}
{{- if not .Values.autoscaling.enabled }}
replicas: 1
serviceName: {{ include "appsmith.fullname" . }}
updateStrategy:
{{- else }}
replicas: {{ .Values.replicas | default 1 }}
{{- end }}
strategy:
type: {{ .Values.strategyType | default "RollingUpdate" }}
rollingUpdate:
maxSurge: {{ dig "maxSurge" 1 $updateStrategy }}
maxUnavailable: {{ dig "maxUnavailable" "0" $updateStrategy }}
{{- else }}
replicas: 1
serviceName: {{ include "appsmith.fullname" . }}
updateStrategy:
{{- end }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
selector:
matchLabels:
Expand Down Expand Up @@ -182,7 +186,7 @@ spec:
{{- if not .Values.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if and (not .Values.autoscaling.enabled) (.Values.persistence.enabled) }}
{{- else if and (not $useDeployment) (.Values.persistence.enabled) }}
volumeClaimTemplates:
- metadata:
name: data
Expand Down
4 changes: 3 additions & 1 deletion deploy/helm/templates/persistentVolume.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) ( .Values.autoscaling.enabled) }}
{{- $workloadKind := upper (toString .Values.workload.kind) -}}
{{- $useDeployment := or (eq $workloadKind "DEPLOYMENT") .Values.autoscaling.enabled }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) $useDeployment }}
apiVersion: v1
kind: PersistentVolume
metadata:
Expand Down
4 changes: 3 additions & 1 deletion deploy/helm/templates/persistentVolumeClaim.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) ( .Values.autoscaling.enabled) }}
{{- $workloadKind := upper (toString .Values.workload.kind) -}}
{{- $useDeployment := or (eq $workloadKind "DEPLOYMENT") .Values.autoscaling.enabled }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) $useDeployment }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.6.5
appsmith.sh/chart: appsmith-3.6.6
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
3: |
Expand All @@ -36,7 +36,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.6.5
appsmith.sh/chart: appsmith-3.6.6
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -143,7 +143,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.6.5
appsmith.sh/chart: appsmith-3.6.6
name: RELEASE-NAME-appsmith-headless
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -182,7 +182,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.6.5
appsmith.sh/chart: appsmith-3.6.6
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
spec:
Expand All @@ -203,7 +203,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.6.5
appsmith.sh/chart: appsmith-3.6.6
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
secrets:
Expand Down
52 changes: 52 additions & 0 deletions deploy/helm/tests/persistence_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
templates:
- persistentVolume.yaml
- persistentVolumeClaim.yaml
tests:
# Test PersistentVolume creation
- name: PV and PVC should be created when persistence enabled, no existing claim, and autoscaling enabled
set:
persistence:
enabled: true
existingClaim:
enabled: false
autoscaling:
enabled: true
asserts:
- isKind:
of: PersistentVolumeClaim
template: persistentVolumeClaim.yaml
- isKind:
of: PersistentVolume
template: persistentVolume.yaml

- name: PVC should NOT be created when persistence is disabled
set:
persistence:
enabled: false
existingClaim:
enabled: false
autoscaling:
enabled: true
asserts:
- hasDocuments:
count: 0

- name: PV and PVC should not be created when using existing claim
set:
persistence:
enabled: true
existingClaim:
enabled: true
autoscaling:
enabled: true
asserts:
- hasDocuments:
count: 0

- name: PV and PVC should not be created when autoscaling is disabled
set:
autoscaling:
enabled: false
asserts:
- hasDocuments:
count: 0
33 changes: 33 additions & 0 deletions deploy/helm/tests/workload_type_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
templates:
- deployment.yaml
tests:
- name: workload type should be StatefulSet when not set
asserts:
- equal:
path: kind
value: StatefulSet
- name: workload type should be Deployment when set
set:
workload:
kind: Deployment
asserts:
- equal:
path: kind
value: Deployment
- name: replica count should be used when set
set:
workload:
kind: Deployment
replicas: 99
asserts:
- equal:
path: spec.replicas
value: 99
- name: workload type should be Deployment when autoscaling is enabled
set:
autoscaling:
enabled: true
asserts:
- equal:
path: kind
value: Deployment
12 changes: 12 additions & 0 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ resources:
cpu: 500m
memory: 3000Mi

## @param workload.kind Select workload resource type: Deployment or StatefulSet
## When set to Deployment, the chart creates a Deployment instead of a StatefulSet.
## Note: This value is ignored when autoscaling.enabled is true (Deployment is used).
##
workload:
kind: StatefulSet

## @param replicas Number of replicas when autoscaling is disabled
## Only used when workload.kind is Deployment and autoscaling.enabled is false
##
replicas: 1

autoscaling:
enabled: false
minReplicas: 2
Expand Down