From c1f0132a936197ae92aafcf442ac85ff8c36eedb Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Fri, 18 Sep 2020 16:09:51 +0200 Subject: [PATCH 1/5] Bump version --- couchdb/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchdb/Chart.yaml b/couchdb/Chart.yaml index 206f9c0..889735f 100644 --- a/couchdb/Chart.yaml +++ b/couchdb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: couchdb -version: 3.3.3 +version: 3.4.0 appVersion: 2.3.1 description: A database featuring seamless multi-master sync, that scales from big data to mobile, with an intuitive HTTP/JSON API and designed for From 8d015b98fc9aa4304d89c92d45559b55de862bce Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Mon, 21 Sep 2020 15:30:06 +0200 Subject: [PATCH 2/5] Run _cluster_setup after installation --- couchdb/templates/clustersetup.yaml | 76 +++++++++++++++++++++++++++++ couchdb/values.yaml | 2 + 2 files changed, 78 insertions(+) create mode 100644 couchdb/templates/clustersetup.yaml diff --git a/couchdb/templates/clustersetup.yaml b/couchdb/templates/clustersetup.yaml new file mode 100644 index 0000000..e00ab87 --- /dev/null +++ b/couchdb/templates/clustersetup.yaml @@ -0,0 +1,76 @@ +{{ if .Values.clusterSetup }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: cluster-setup-script + labels: + app: {{ template "couchdb.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + setup.sh: | + set -e + BASE_URL=http://{{ template "couchdb.fullname" . }}:5984 + set -x + + echo "Waiting for CouchDB service to start..." + until curl --silent -max-time 5 --head --fail "${BASE_URL}/_up"; do + printf "%s: CouchDB not up yet. Will try again\n" "$(date)" + sleep 2 + done + + echo "Initializing cluster" + touch /tmp/curl.cf + {{ if not .Values.allowAdminParty }} + echo "-u $(cat /tmp/admin-password/adminUsername):$(cat /tmp/admin-password/adminPassword)" >> /tmp/curl.cf + {{ end }} + curl -silent "${BASE_URL}/_cluster_setup" \ + -H "Content-Type: application/json" \ + -d '{"action": "finish_cluster"}' \ + -K /tmp/curl.cf + + echo "Success!" +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: cluster-setup-job + labels: + app: {{ template "couchdb.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + "helm.sh/hook": post-install + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: cluster-setup-job + labels: + app: {{ template "couchdb.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + spec: + restartPolicy: Never + volumes: + - name: admin-password-volume + secret: + secretName: {{ template "couchdb.fullname" . }} + - name: cluster-setup-script-volume + configMap: + name: cluster-setup-script + containers: + - name: cluster-setup-job + image: "curlimages/curl:7.72.0" + command: [ "/bin/sh", "/tmp/setup/setup.sh" ] + volumeMounts: + - name: admin-password-volume + readOnly: true + mountPath: /tmp/admin-password + - name: cluster-setup-script-volume + mountPath: /tmp/setup +{{ end }} diff --git a/couchdb/values.yaml b/couchdb/values.yaml index 6a35426..cff9cc2 100644 --- a/couchdb/values.yaml +++ b/couchdb/values.yaml @@ -22,6 +22,8 @@ allowAdminParty: false ## created ahead of time. createAdminSecret: true +clusterSetup: false + adminUsername: admin # adminPassword: this_is_not_secure # adminHash: -pbkdf2-this_is_not_necessarily_secure_either From 7c7d7cfdc631635c104c9d9df38f50226af70a16 Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Mon, 21 Sep 2020 15:34:23 +0200 Subject: [PATCH 3/5] Update documentation --- couchdb/README.md | 1 + couchdb/templates/NOTES.txt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/couchdb/README.md b/couchdb/README.md index ca3716b..fab0a85 100644 --- a/couchdb/README.md +++ b/couchdb/README.md @@ -142,6 +142,7 @@ CouchDB chart and their default values: | `couchdbConfig` | Map allowing override elements of server .ini config | *See below* | | `allowAdminParty` | If enabled, start cluster without admin account | false (requires creating a Secret) | | `createAdminSecret` | If enabled, create an admin account and cookie secret | true | +| `clusterSetup` | Finalize cluster configuration by calling /_cluster_setup endpoint after installation | false | | `schedulerName` | Name of the k8s scheduler (other than default) | `nil` | | `erlangFlags` | Map of flags supplied to the underlying Erlang VM | name: couchdb, setcookie: monster | `persistentVolume.enabled` | Boolean determining whether to attach a PV to each node | false diff --git a/couchdb/templates/NOTES.txt b/couchdb/templates/NOTES.txt index a3658bd..483b73c 100644 --- a/couchdb/templates/NOTES.txt +++ b/couchdb/templates/NOTES.txt @@ -2,13 +2,12 @@ Apache CouchDB is starting. Check the status of the Pods using: kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "couchdb.name" . }},release={{ .Release.Name }}" -Once all of the Pods are fully Ready, execute the following command to create +Once all of the pods are fully ready, execute the following command to create some required system databases: kubectl exec --namespace {{ .Release.Namespace }} {{ if not .Values.allowAdminParty }}-it {{ end }}{{ template "couchdb.fullname" . }}-0 -c couchdb -- \ curl -s \ http://127.0.0.1:5984/_cluster_setup \ - -X POST \ -H "Content-Type: application/json" \ {{- if .Values.allowAdminParty }} -d '{"action": "finish_cluster"}' @@ -18,3 +17,6 @@ some required system databases: {{- end }} Then it's time to relax. + +As of chart version 3.4.0, the helm chart will attempt automatically to complete +cluster setup after installation if the `clusterSetup` value is set to true. \ No newline at end of file From 45a9d7566a54ccd55a3b1073c5b317f02b75e43b Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Mon, 21 Sep 2020 15:40:19 +0200 Subject: [PATCH 4/5] Add packaged chart to docs/ directory --- docs/couchdb-3.4.0.tgz | Bin 0 -> 10328 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/couchdb-3.4.0.tgz diff --git a/docs/couchdb-3.4.0.tgz b/docs/couchdb-3.4.0.tgz new file mode 100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wd?*9FA|J* Date: Mon, 21 Sep 2020 16:16:50 +0200 Subject: [PATCH 5/5] Set curl credentials for require_valid_user, as well This does mean that we now send credentials for the /_up endpoint even when require_valid_user is not set, but this should not hurt anything. --- couchdb/templates/clustersetup.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/couchdb/templates/clustersetup.yaml b/couchdb/templates/clustersetup.yaml index e00ab87..fab3298 100644 --- a/couchdb/templates/clustersetup.yaml +++ b/couchdb/templates/clustersetup.yaml @@ -15,17 +15,18 @@ data: BASE_URL=http://{{ template "couchdb.fullname" . }}:5984 set -x + touch /tmp/curl.cf + {{ if or .Values.couchdbConfig.chttpd.require_valid_user (not .Values.allowAdminParty) }} + echo "-u $(cat /tmp/admin-password/adminUsername):$(cat /tmp/admin-password/adminPassword)" >> /tmp/curl.cf + {{ end }} + echo "Waiting for CouchDB service to start..." - until curl --silent -max-time 5 --head --fail "${BASE_URL}/_up"; do + until curl --silent --max-time 5 --head --fail "${BASE_URL}/_up" -K /tmp/curl.cf; do printf "%s: CouchDB not up yet. Will try again\n" "$(date)" sleep 2 done echo "Initializing cluster" - touch /tmp/curl.cf - {{ if not .Values.allowAdminParty }} - echo "-u $(cat /tmp/admin-password/adminUsername):$(cat /tmp/admin-password/adminPassword)" >> /tmp/curl.cf - {{ end }} curl -silent "${BASE_URL}/_cluster_setup" \ -H "Content-Type: application/json" \ -d '{"action": "finish_cluster"}' \