From 6f7926015a83b720382a20da151075a069c3f783 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 8 Dec 2021 13:19:43 +0000 Subject: [PATCH] ensure that dry runs between budibase-infra and standard templates match --- .../templates/app-service-deployment.yaml | 6 +-- .../budibase/templates/couchdb-backup.yaml | 43 +++++++++++++++++++ .../templates/worker-service-deployment.yaml | 6 +-- hosting/kubernetes/budibase/values.yaml | 8 +++- 4 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 hosting/kubernetes/budibase/templates/couchdb-backup.yaml diff --git a/hosting/kubernetes/budibase/templates/app-service-deployment.yaml b/hosting/kubernetes/budibase/templates/app-service-deployment.yaml index 949a8f6286..5e45474c8a 100644 --- a/hosting/kubernetes/budibase/templates/app-service-deployment.yaml +++ b/hosting/kubernetes/budibase/templates/app-service-deployment.yaml @@ -73,17 +73,13 @@ spec: name: {{ template "budibase.fullname" . }} key: objectStoreSecret - name: MINIO_URL - {{ 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: MULTI_TENANCY value: {{ .Values.globals.multiTenancy | quote }} - name: LOG_LEVEL - value: {{ .Values.services.apps.logLevel | quote }} + value: {{ default "info" .Values.services.apps.logLevel | quote }} - name: REDIS_PASSWORD value: {{ .Values.services.redis.password }} - name: REDIS_URL diff --git a/hosting/kubernetes/budibase/templates/couchdb-backup.yaml b/hosting/kubernetes/budibase/templates/couchdb-backup.yaml new file mode 100644 index 0000000000..8d9c368864 --- /dev/null +++ b/hosting/kubernetes/budibase/templates/couchdb-backup.yaml @@ -0,0 +1,43 @@ +{{- if .Values.services.couchdb.backup.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.21.0 (992df58d8) + creationTimestamp: null + labels: + app.kubernetes.io/name: couchdb-backup + name: couchdb-backup +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: couchdb-backup + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.21.0 (992df58d8) + creationTimestamp: null + labels: + app.kubernetes.io/name: couchdb-backup + spec: + containers: + - env: + - name: SOURCE + value: {{ .Values.services.couchdb.url }} + - name: TARGET + value: {{ .Values.services.couchdb.backup.target }} + - name: RUN_EVERY_SECS + value: {{ .Values.services.couchdb.backup.interval }} + - name: VERBOSE + value: "true" + image: redgeoff/replicate-couchdb-cluster + imagePullPolicy: Always + name: couchdb-backup + resources: {} +status: {} +{{- end }} diff --git a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml index 858587be1c..70249123d0 100644 --- a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml +++ b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml @@ -70,17 +70,13 @@ spec: name: {{ template "budibase.fullname" . }} key: objectStoreSecret - name: MINIO_URL - {{ 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: MULTI_TENANCY value: {{ .Values.globals.multiTenancy | quote }} - name: LOG_LEVEL - value: {{ .Values.services.worker.logLevel | quote }} + value: {{ default "info" .Values.services.worker.logLevel | quote }} - name: REDIS_PASSWORD value: {{ .Values.services.redis.password | quote }} - name: REDIS_URL diff --git a/hosting/kubernetes/budibase/values.yaml b/hosting/kubernetes/budibase/values.yaml index fe48a7b7e0..24197383e2 100644 --- a/hosting/kubernetes/budibase/values.yaml +++ b/hosting/kubernetes/budibase/values.yaml @@ -129,6 +129,12 @@ services: # user: "" # only change if pointing to existing couch server # password: "" # only change if pointing to existing couch server port: 5984 + backup: + enabled: false + # target couchDB instance to back up to + target: "" + # backup interval in seconds + interval: "" redis: enabled: true # disable if using external redis @@ -146,7 +152,7 @@ services: accessKey: "" # AWS_ACCESS_KEY if using S3 or existing minio access key secretKey: "" # AWS_SECRET_ACCESS_KEY if using S3 or existing minio secret region: "" # AWS_REGION if using S3 or existing minio secret - url: "" # only change if pointing to existing minio cluster and minio: false + url: "http://minio-service:9000" # only change if pointing to existing minio cluster or S3 and minio: false storage: 100Mi # Override values in couchDB subchart