2021-10-02 06:16:07 +00:00
|
|
|
apiVersion: apps/v1
|
2022-03-24 07:39:27 +00:00
|
|
|
kind: StatefulSet
|
2021-10-02 06:16:07 +00:00
|
|
|
metadata:
|
|
|
|
|
name: {{ include "appsmith.fullname" . }}
|
|
|
|
|
namespace: {{ include "appsmith.namespace" . }}
|
|
|
|
|
labels:
|
|
|
|
|
{{- include "appsmith.labels" . | nindent 4 }}
|
|
|
|
|
spec:
|
|
|
|
|
replicas: 1
|
|
|
|
|
serviceName: {{ include "appsmith.fullname" . }}
|
|
|
|
|
updateStrategy:
|
|
|
|
|
type: {{ .Values.strategyType }}
|
|
|
|
|
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:
|
|
|
|
|
{{- 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 }}
|
2023-07-07 04:31:43 +00:00
|
|
|
image: "docker.io/library/redis:6.2-alpine"
|
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 }}
|
2023-07-07 04:31:43 +00:00
|
|
|
image: "docker.io/bitnami/mongodb:5.0.17-debian-11-r5"
|
2023-01-02 09:26:15 +00:00
|
|
|
{{- end }}
|
2022-10-14 10:45:49 +00:00
|
|
|
command: ['sh', '-c', "until mongo --host appsmith-mongodb.{{.Release.Namespace}}.svc.cluster.local --eval 'db.runCommand({ping:1})' ; do echo waiting for mongo; sleep 2; done"]
|
|
|
|
|
{{- end }}
|
2021-10-02 06:16:07 +00:00
|
|
|
containers:
|
|
|
|
|
- name: {{ .Values.containerName }}
|
|
|
|
|
securityContext:
|
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
|
|
|
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
|
ports:
|
|
|
|
|
- name: http
|
|
|
|
|
containerPort: 80
|
|
|
|
|
protocol: TCP
|
|
|
|
|
- name: https
|
|
|
|
|
containerPort: 443
|
|
|
|
|
protocol: TCP
|
|
|
|
|
- name: supervisord
|
|
|
|
|
containerPort: 9001
|
|
|
|
|
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:
|
|
|
|
|
port: http
|
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:
|
|
|
|
|
port: http
|
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:
|
|
|
|
|
port: http
|
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
|
2023-09-04 11:25:37 +00:00
|
|
|
env:
|
|
|
|
|
- name: APPSMITH_ENABLE_EMBEDDED_DB
|
|
|
|
|
value: "0"
|
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 }}
|
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:
|
|
|
|
|
{{- if not .Values.persistence.enabled }}
|
|
|
|
|
- name: data
|
|
|
|
|
emptyDir: {}
|
|
|
|
|
{{- else }}
|
|
|
|
|
volumeClaimTemplates:
|
|
|
|
|
- metadata:
|
|
|
|
|
name: data
|
|
|
|
|
{{- if .Values.persistence.annotations }}
|
2021-12-28 07:20:37 +00:00
|
|
|
annotations: {{- include "tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
2021-10-02 06:16:07 +00:00
|
|
|
{{- end }}
|
|
|
|
|
spec:
|
|
|
|
|
accessModes:
|
|
|
|
|
{{- range .Values.persistence.accessModes }}
|
|
|
|
|
- {{ . | quote }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
storage: {{ .Values.persistence.size | quote }}
|
2021-12-28 07:20:37 +00:00
|
|
|
{{ include "storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }}
|
2022-08-04 09:51:23 +00:00
|
|
|
{{- end }}
|