2024-12-31 12:31:48 +00:00
|
|
|
{{- $updateStrategy := .Values.updateStrategy | default dict }}
|
|
|
|
|
{{- $postgresuser := .Values.postgresql.auth.username }}
|
|
|
|
|
{{- $postgrespass := .Values.postgresql.auth.password }}
|
|
|
|
|
{{- $postgrespass := .Values.postgresql.auth.password }}
|
|
|
|
|
{{- $releaseName := include "appsmith.fullname" . -}}
|
2021-10-02 06:16:07 +00:00
|
|
|
apiVersion: apps/v1
|
2024-12-31 12:31:48 +00:00
|
|
|
kind: {{ if not .Values.autoscaling.enabled }}StatefulSet{{- else }}Deployment{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
metadata:
|
|
|
|
|
name: {{ include "appsmith.fullname" . }}
|
|
|
|
|
namespace: {{ include "appsmith.namespace" . }}
|
|
|
|
|
labels:
|
|
|
|
|
{{- include "appsmith.labels" . | nindent 4 }}
|
|
|
|
|
spec:
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- if not .Values.autoscaling.enabled }}
|
2021-10-02 06:16:07 +00:00
|
|
|
replicas: 1
|
|
|
|
|
serviceName: {{ include "appsmith.fullname" . }}
|
|
|
|
|
updateStrategy:
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- else }}
|
|
|
|
|
strategy:
|
|
|
|
|
type: {{ .Values.strategyType | default "RollingUpdate" }}
|
|
|
|
|
rollingUpdate:
|
|
|
|
|
maxSurge: {{ dig "maxSurge" 1 $updateStrategy }}
|
|
|
|
|
maxUnavailable: {{ dig "maxUnavailable" "0" $updateStrategy }}
|
|
|
|
|
{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
{{- include "appsmith.selectorLabels" . | nindent 6 }}
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
{{- with .Values.podAnnotations }}
|
|
|
|
|
annotations:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
labels:
|
|
|
|
|
{{- include "appsmith.selectorLabels" . | nindent 8 }}
|
2022-08-04 09:51:23 +00:00
|
|
|
{{- if .Values.podLabels }}
|
|
|
|
|
{{- toYaml .Values.podLabels | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
spec:
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- with .Values.topologySpreadConstraints }}
|
|
|
|
|
topologySpreadConstraints:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
{{- if .Values.schedulerName }}
|
|
|
|
|
schedulerName: {{ .Values.schedulerName | quote }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
serviceAccountName: {{ template "appsmith.serviceAccountName" . }}
|
|
|
|
|
securityContext:
|
|
|
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
|
nodeSelector:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
|
affinity:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
|
tolerations:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2022-10-14 10:45:49 +00:00
|
|
|
initContainers:
|
|
|
|
|
{{- if .Values.redis.enabled }}
|
|
|
|
|
- name: redis-init-container
|
2023-01-02 09:26:15 +00:00
|
|
|
{{- if ((.Values.initContainer.redis).image) }}
|
|
|
|
|
image: {{ .Values.initContainer.redis.image }}
|
|
|
|
|
{{- else }}
|
2025-02-10 09:06:37 +00:00
|
|
|
image: "docker.io/redis:7.0.15"
|
2023-01-02 09:26:15 +00:00
|
|
|
{{- end }}
|
2023-07-31 09:25:57 +00:00
|
|
|
command: ['sh', '-c', "until redis-cli -h {{.Release.Name}}-redis-master.{{.Release.Namespace}}.svc.cluster.local ping ; do echo waiting for redis; sleep 2; done"]
|
2022-10-14 10:45:49 +00:00
|
|
|
{{- end }}
|
|
|
|
|
{{- if .Values.mongodb.enabled }}
|
|
|
|
|
- name: mongo-init-container
|
2023-01-02 09:26:15 +00:00
|
|
|
{{- if ((.Values.initContainer.mongodb).image) }}
|
|
|
|
|
image: {{ .Values.initContainer.mongodb.image }}
|
|
|
|
|
{{- else }}
|
2024-12-31 12:31:48 +00:00
|
|
|
image: "docker.io/bitnami/mongodb:6.0.13"
|
|
|
|
|
{{- end }}
|
|
|
|
|
command: ['sh', '-c', "until mongosh --host appsmith-mongodb.{{.Release.Namespace}}.svc.cluster.local --eval 'db.runCommand({ping:1})' ; do echo waiting for mongo; sleep 2; done"]
|
2023-01-02 09:26:15 +00:00
|
|
|
{{- end }}
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- if .Values.postgresql.enabled }}
|
|
|
|
|
- name: psql-init-container
|
|
|
|
|
{{- if ((.Values.initContainer.postgresql).image) }}
|
|
|
|
|
image: {{ .Values.initContainer.postgresql.image }}
|
|
|
|
|
{{- else}}
|
|
|
|
|
image: docker.io/bitnami/postgresql:14.5.0-debian-11-r21
|
|
|
|
|
{{- end}}
|
|
|
|
|
command: ['sh', '-c', "until pg_isready -U $postgresuser -d $postgresdb -h {{.Release.Name}}-postgresql.{{.Release.Namespace}}.svc.cluster.local; do echo waiting for postgresql; sleep 2; done"]
|
2022-10-14 10:45:49 +00:00
|
|
|
{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
containers:
|
|
|
|
|
- name: {{ .Values.containerName }}
|
|
|
|
|
securityContext:
|
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- $customImage := .Values._image | default dict }}
|
|
|
|
|
image: {{ dig "registry" "index.docker.io" $customImage }}/{{ dig "repository" "appsmith/appsmith-ee" $customImage }}:{{ dig "tag" (.Values.image.tag | default "latest") $customImage }}
|
|
|
|
|
imagePullPolicy: {{ dig "pullPolicy" "IfNotPresent" $customImage }}
|
2021-10-02 06:16:07 +00:00
|
|
|
ports:
|
|
|
|
|
- name: http
|
2024-11-01 09:46:00 +00:00
|
|
|
containerPort: {{ .Values.HTTPContainerPort | default 80 }}
|
2021-10-02 06:16:07 +00:00
|
|
|
protocol: TCP
|
|
|
|
|
- name: https
|
|
|
|
|
containerPort: 443
|
|
|
|
|
protocol: TCP
|
2024-12-31 12:31:48 +00:00
|
|
|
- name: metrics
|
|
|
|
|
containerPort: {{ .Values.metrics.port }}
|
|
|
|
|
protocol: TCP
|
2023-07-07 04:31:43 +00:00
|
|
|
{{- $probes := .Values.probes | default dict }}
|
2022-08-04 10:28:18 +00:00
|
|
|
startupProbe:
|
|
|
|
|
# The `livenessProbe` and `readinessProbe` will be disabled until the `startupProbe` is successful.
|
|
|
|
|
httpGet:
|
2024-12-31 12:31:48 +00:00
|
|
|
port: {{ dig "startupProbe" "port" "80" $probes }}
|
2023-07-07 04:31:43 +00:00
|
|
|
path: {{ dig "startupProbe" "api" "/api/v1/health" $probes }}
|
|
|
|
|
failureThreshold: {{ dig "startupProbe" "failureThreshold" 3 $probes }}
|
|
|
|
|
periodSeconds: {{ dig "startupProbe" "periodSeconds" 60 $probes }}
|
2021-10-02 06:16:07 +00:00
|
|
|
livenessProbe:
|
|
|
|
|
httpGet:
|
2024-12-31 12:31:48 +00:00
|
|
|
port: {{ dig "livenessProbe" "port" "80" $probes }}
|
2023-07-07 04:31:43 +00:00
|
|
|
path: {{ dig "livenessProbe" "api" "/api/v1/health" $probes }}
|
|
|
|
|
failureThreshold: {{ dig "livenessProbe" "failureThreshold" 3 $probes }}
|
|
|
|
|
periodSeconds: {{ dig "livenessProbe" "periodSeconds" 60 $probes }}
|
2021-10-02 06:16:07 +00:00
|
|
|
readinessProbe:
|
|
|
|
|
httpGet:
|
2024-12-31 12:31:48 +00:00
|
|
|
port: {{ dig "readinessProbe" "port" "80" $probes }}
|
2023-07-07 04:31:43 +00:00
|
|
|
path: {{ dig "readinessProbe" "api" "/api/v1/health" $probes }}
|
|
|
|
|
failureThreshold: {{ dig "readinessProbe" "failureThreshold" 3 $probes }}
|
|
|
|
|
periodSeconds: {{ dig "readinessProbe" "periodSeconds" 60 $probes }}
|
2021-10-02 06:16:07 +00:00
|
|
|
resources:
|
|
|
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- name: data
|
|
|
|
|
mountPath: /appsmith-stacks
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- if .Values.customCAcert }}
|
|
|
|
|
- name: ca-cert
|
|
|
|
|
mountPath: "/appsmith-stacks/ca-certs"
|
|
|
|
|
{{- end }}
|
2023-09-04 11:25:37 +00:00
|
|
|
env:
|
2024-11-01 09:46:00 +00:00
|
|
|
{{- if .Values.HTTPContainerPort }}
|
|
|
|
|
- name: PORT
|
|
|
|
|
value: "{{ .Values.HTTPContainerPort }}"
|
|
|
|
|
{{- end }}
|
2023-09-04 11:25:37 +00:00
|
|
|
- name: APPSMITH_ENABLE_EMBEDDED_DB
|
|
|
|
|
value: "0"
|
2024-12-31 12:31:48 +00:00
|
|
|
- name: JGROUPS_DISCOVERY_PROTOCOL
|
|
|
|
|
value: kubernetes.KUBE_PING
|
|
|
|
|
- name: APPSMITH_HEADLESS_SVC
|
|
|
|
|
value: {{ include "appsmith.fullname" . }}-headless
|
2025-06-04 15:24:46 +00:00
|
|
|
{{- if .Values.securityContext.runAsUser | default nil }}
|
|
|
|
|
# ensure the interactive shell when connected via kubectl exec is set
|
|
|
|
|
- name: LD_PRELOAD
|
|
|
|
|
value: /usr/local/lib/libnss_wrapper.so
|
|
|
|
|
{{- end }}
|
2022-01-31 07:57:01 +00:00
|
|
|
envFrom:
|
|
|
|
|
- configMapRef:
|
|
|
|
|
name: {{ include "appsmith.fullname" . }}
|
2022-05-04 10:51:15 +00:00
|
|
|
{{- if .Values.secretName }}
|
|
|
|
|
- secretRef:
|
|
|
|
|
name: {{ .Values.secretName }}
|
|
|
|
|
{{- end }}
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- if .Values.secrets }}
|
|
|
|
|
- secretRef:
|
|
|
|
|
name: {{ include "appsmith.fullname" . }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .Values.externalSecrets.enabled }}
|
|
|
|
|
- secretRef:
|
|
|
|
|
name: "{{ include "appsmith.fullname" . }}-external-secret"
|
|
|
|
|
{{- end }}
|
2023-01-17 07:31:28 +00:00
|
|
|
{{- if .Values.image.pullSecrets}}
|
|
|
|
|
imagePullSecrets:
|
|
|
|
|
- name: {{ .Values.image.pullSecrets }}
|
|
|
|
|
{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
volumes:
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- if .Values.customCAcert }}
|
|
|
|
|
- name: ca-cert
|
|
|
|
|
configMap:
|
|
|
|
|
name: {{ $releaseName }}-trustedca
|
|
|
|
|
items:
|
|
|
|
|
{{- range $key, $value := .Values.customCAcert }}
|
|
|
|
|
- key: {{ $key }}
|
|
|
|
|
path: {{ $key }}.crt
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
{{- if not .Values.persistence.enabled }}
|
|
|
|
|
- name: data
|
|
|
|
|
emptyDir: {}
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- else if and (not .Values.autoscaling.enabled) (.Values.persistence.enabled) }}
|
2021-10-02 06:16:07 +00:00
|
|
|
volumeClaimTemplates:
|
|
|
|
|
- metadata:
|
|
|
|
|
name: data
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- if .Values.persistence.annotations}}
|
|
|
|
|
annotations:
|
|
|
|
|
{{- include "tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
2021-10-02 06:16:07 +00:00
|
|
|
{{- end }}
|
|
|
|
|
spec:
|
|
|
|
|
accessModes:
|
2024-12-31 12:31:48 +00:00
|
|
|
- ReadWriteOnce
|
2021-10-02 06:16:07 +00:00
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
storage: {{ .Values.persistence.size | quote }}
|
2024-12-31 12:31:48 +00:00
|
|
|
{{- if .Values.persistence.volumeClaimTemplates.selector }}
|
|
|
|
|
selector:
|
|
|
|
|
{{- include "tplvalues.render" (dict "value" .Values.persistence.volumeClaimTemplates.selector "context" $) | nindent 10 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{ include "storage.class" (dict "persistence" .Values.persistence "global" .Values.global) | nindent 8 }}
|
|
|
|
|
{{- else }}
|
|
|
|
|
- name: data
|
|
|
|
|
persistentVolumeClaim:
|
|
|
|
|
{{- if .Values.persistence.existingClaim.enabled }}
|
|
|
|
|
claimName: {{ .Values.persistence.existingClaim.claimName }}
|
|
|
|
|
{{- else }}
|
|
|
|
|
claimName: {{ include "appsmith.fullname" . }}
|
|
|
|
|
{{- end }}
|
2022-08-04 09:51:23 +00:00
|
|
|
{{- end }}
|