From 1b78d8349fcae4f8a22d331b0c6aa9805db00d82 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 16 Aug 2021 19:00:08 +0100 Subject: [PATCH] totally generic templates complete, pending test in different clouds --- .../templates/app-service-deployment.yaml | 34 +++++++++++++++---- .../templates/worker-service-deployment.yaml | 23 +++++++++++-- hosting/kubernetes/budibase/values.yaml | 2 +- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/hosting/kubernetes/budibase/templates/app-service-deployment.yaml b/hosting/kubernetes/budibase/templates/app-service-deployment.yaml index 16b7bdddec..24728c175f 100644 --- a/hosting/kubernetes/budibase/templates/app-service-deployment.yaml +++ b/hosting/kubernetes/budibase/templates/app-service-deployment.yaml @@ -29,8 +29,22 @@ spec: - name: BUDIBASE_ENVIRONMENT value: {{ .Values.globals.budibaseEnv }} - name: COUCH_DB_URL - # Or inject value directly - value: couchdb-service.{{ include "budibase.serviceDns" . }}:{{ .Values.services.couchdb.port }} + {{ if .Values.services.couchdb.url }} + value: {{ .Values.services.couchdb.url }} + {{ else }} + # value: http://{{ .Release.Name }}-svc-couchdb.{{ include "budibase.serviceDns" . }}:{{ .Values.services.couchdb.port }} + value: http://{{ .Release.Name }}-svc-couchdb:{{ .Values.services.couchdb.port }} + {{ end }} + - name: COUCH_DB_USER + valueFrom: + secretKeyRef: + name: {{ template "couchdb.fullname" . }} + key: adminUsername + - name: COUCH_DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "couchdb.fullname" . }} + key: adminPassword - name: ENABLE_ANALYTICS value: {{ .Values.globals.enableAnalytics | quote }} - name: INTERNAL_API_KEY @@ -56,21 +70,27 @@ spec: name: {{ template "budibase.fullname" . }} key: objectStoreSecret - name: MINIO_URL - # Or inject value directly - value: minio-service.{{ include "budibase.serviceDns" . }}{{ .Values.services.objectStore.port }} + {{ if .Values.services.objectStore.url }} + value: {{ .Values.services.objectStore.url }} + {{ else }} + value: http://minio-service:{{ .Values.services.objectStore.port }} + {{ end }} - name: PORT value: {{ .Values.services.apps.port | quote }} - name: REDIS_PASSWORD value: {{ .Values.services.redis.password }} - name: REDIS_URL - # Or inject value directly - value: redis-service.{{ include "budibase.serviceDns" . }}:{{ .Values.services.redis.port }} + {{ if .Values.services.redis.url }} + value: {{ .Values.services.redis.url }} + {{ else }} + value: redis-service:{{ .Values.services.redis.port }} + {{ end }} - name: SELF_HOSTED value: {{ .Values.globals.selfHosted | quote }} - name: SENTRY_DSN value: {{ .Values.globals.sentryDSN }} - name: WORKER_URL - value: worker-service.{{ include "budibase.serviceDns" . }}:{{ .Values.services.worker.port }} + value: worker-service:{{ .Values.services.worker.port }} image: budibase/apps imagePullPolicy: Always name: bbapps diff --git a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml index 1596b74bec..af6212751f 100644 --- a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml +++ b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml @@ -34,13 +34,22 @@ spec: secretKeyRef: name: {{ template "couchdb.fullname" . }} key: adminUsername + - name: COUCH_DB_USER + valueFrom: + secretKeyRef: + name: {{ template "couchdb.fullname" . }} + key: adminUsername - name: COUCH_DB_PASSWORD valueFrom: secretKeyRef: name: {{ template "couchdb.fullname" . }} key: adminPassword - name: COUCH_DB_URL - value: http://couchdb-service.{{ include "budibase.serviceDns" . }}:{{ .Values.services.couchdb.port }} + {{ if .Values.services.couchdb.url }} + value: {{ .Values.services.couchdb.url }} + {{ else }} + value: http://{{ .Release.Name }}-svc-couchdb:{{ .Values.services.couchdb.port }} + {{ end }} - name: INTERNAL_API_KEY valueFrom: secretKeyRef: @@ -62,13 +71,21 @@ spec: name: {{ template "budibase.fullname" . }} key: objectStoreSecret - name: MINIO_URL - value: minio-service.{{ include "budibase.serviceDns" . }}{{ .Values.services.objectStore.port }} + {{ if .Values.services.objectStore.url }} + value: {{ .Values.services.objectStore.url }} + {{ else }} + value: http://minio-service:{{ .Values.services.objectStore.port }} + {{ end }} - name: PORT value: {{ .Values.services.worker.port | quote }} - name: REDIS_PASSWORD value: {{ .Values.services.redis.password | quote }} - name: REDIS_URL - value: redis-service.{{ include "budibase.serviceDns" . }}{{ .Values.services.redis.port }} + {{ if .Values.services.redis.url }} + value: {{ .Values.services.redis.url }} + {{ else }} + value: redis-service:{{ .Values.services.redis.port }} + {{ end }} - name: SELF_HOSTED value: {{ .Values.globals.selfHosted | quote }} image: budibase/worker diff --git a/hosting/kubernetes/budibase/values.yaml b/hosting/kubernetes/budibase/values.yaml index a71ad09b59..b3b81bebf4 100644 --- a/hosting/kubernetes/budibase/values.yaml +++ b/hosting/kubernetes/budibase/values.yaml @@ -119,7 +119,7 @@ services: url: "" # only change if pointing to existing couch server user: "" # only change if pointing to existing couch server password: "" # only change if pointing to existing couch server - port: 5678 + port: 5984 storage: 100Mi redis: