diff --git a/.gitignore b/.gitignore index a37763e088..b0fd03c741 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ app/client/perf/traces/* .history stacks +# helm dependencies +deploy/helm/charts + # yalc files ## This is for integrating design-system changes during development app/client/.yalc/ diff --git a/deploy/helm/Chart.lock b/deploy/helm/Chart.lock index e69de29bb2..d76432512c 100644 --- a/deploy/helm/Chart.lock +++ b/deploy/helm/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: redis + repository: https://charts.bitnami.com/bitnami + version: 17.0.10 +- name: mongodb + repository: https://charts.bitnami.com/bitnami + version: 10.31.5 +digest: sha256:d1759068c26d23269da82e349b9744e395f2e3ed4dce5cdbd9137580632e3f67 +generated: "2022-09-28T15:45:22.795613+05:30" diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml index ec9631a894..5517d55fc9 100644 --- a/deploy/helm/Chart.yaml +++ b/deploy/helm/Chart.yaml @@ -12,4 +12,15 @@ sources: - https://github.com/appsmithorg/appsmith home: https://www.appsmith.com/ icon: https://assets.appsmith.com/appsmith-icon.png -version: 1.5.3 +version: 2.0.0 +dependencies: +- condition: redis.enabled + name: redis + version: 17.0.10 + appVersion: 6.0.2 + repository: https://charts.bitnami.com/bitnami +- condition: mongodb.enabled + name: mongodb + version: 10.31.5 + appVersion: 4.4.11 + repository: https://charts.bitnami.com/bitnami diff --git a/deploy/helm/templates/configMap.yaml b/deploy/helm/templates/configMap.yaml index 2d5bbc5184..4bc943047b 100644 --- a/deploy/helm/templates/configMap.yaml +++ b/deploy/helm/templates/configMap.yaml @@ -1,3 +1,7 @@ +{{- $nameSpace := include "appsmith.namespace" . -}} +{{- $mongoUser := .Values.mongodb.auth.rootUser -}} +{{- $mongoPassword := .Values.mongodb.auth.rootPassword -}} +{{- $mongoServicename := .Values.mongodb.service.nameOverride -}} apiVersion: v1 kind: ConfigMap metadata: @@ -7,7 +11,17 @@ metadata: {{- include "appsmith.labels" . | nindent 4 }} data: {{- range $key, $value := .Values.applicationConfig }} + {{- if and (eq "APPSMITH_MONGODB_URI" $key) ( not $value) }} + {{- if $.Values.mongodb.enabled }} + {{ $key }}: mongodb+srv://{{ $mongoUser }}:{{ $mongoPassword }}@{{ $mongoServicename }}.{{ $nameSpace }}.svc.cluster.local/appsmith?retryWrites=true&authSource=admin&ssl=false + {{- end }} + {{- end }} + {{- if and (eq "APPSMITH_REDIS_URL" $key) ( not $value) }} + {{- if $.Values.redis.enabled }} + {{ $key }}: redis://appsmith-redis-master.{{ $nameSpace }}.svc.cluster.local:6379 + {{- end }} + {{- end }} {{- if $value }} - {{ $key }}: {{ $value | quote }} + {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} diff --git a/deploy/helm/templates/statefulset.yaml b/deploy/helm/templates/statefulset.yaml index 6937b39c6b..add9ee021f 100644 --- a/deploy/helm/templates/statefulset.yaml +++ b/deploy/helm/templates/statefulset.yaml @@ -43,6 +43,17 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- if .Values.redis.enabled }} + - name: redis-init-container + image: alpine + command: ['sh', '-c', "apk add redis; until redis-cli -h appsmith-redis-master.{{.Release.Namespace}}.svc.cluster.local ping; do echo waiting for redis; sleep 2; done"] + {{- end }} + {{- if .Values.mongodb.enabled }} + - name: mongo-init-container + image: docker.io/bitnami/mongodb:4.4.11-debian-10-r12 + 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 }} containers: - name: {{ .Values.containerName }} securityContext: @@ -70,7 +81,7 @@ spec: port: http readinessProbe: httpGet: - path: / + path: /api/v1/users/me port: http resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index 07400f6f64..2d2b70cc42 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -1,3 +1,22 @@ +## Redis parameters +redis: + enabled: true + auth: + enabled: false + replica: + replicaCount: 1 + +mongodb: + enabled: true + service: + nameOverride: appsmith-mongodb + auth: + rootUser: root + rootPassword : password + replicaCount: 2 + architecture: "replicaset" + replicaSetName: rs0 + ## @section Global parameters ## Global Docker image parameters ## Please, note that this will override the image parameters, including dependencies, configured to use the global value @@ -35,7 +54,7 @@ strategyType: RollingUpdate image: registry: index.docker.io repository: appsmith/appsmith-ce - pullPolicy: Always + pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "latest" ## ServiceAccount