You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fl...@apache.org on 2020/09/21 13:34:41 UTC

[couchdb-helm] branch clusterSetup created (now ed30b9f)

This is an automated email from the ASF dual-hosted git repository.

flimzy pushed a change to branch clusterSetup
in repository https://gitbox.apache.org/repos/asf/couchdb-helm.git.


      at ed30b9f  Update documentation

This branch includes the following new commits:

     new c1f0132  Bump version
     new 768aee8  Run _cluster_setup after installation
     new ed30b9f  Update documentation

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb-helm] 02/03: Run _cluster_setup after installation

Posted by fl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

flimzy pushed a commit to branch clusterSetup
in repository https://gitbox.apache.org/repos/asf/couchdb-helm.git

commit 768aee80fdb0c9adf4d6c256315b0f1563a7c8a6
Author: Jonathan Hall <fl...@flimzy.com>
AuthorDate: Mon Sep 21 15:30:06 2020 +0200

    Run _cluster_setup after installation
---
 couchdb/templates/clustersetup.yaml | 74 +++++++++++++++++++++++++++++++++++++
 couchdb/values.yaml                 |  2 +
 2 files changed, 76 insertions(+)

diff --git a/couchdb/templates/clustersetup.yaml b/couchdb/templates/clustersetup.yaml
new file mode 100644
index 0000000..ee0dfee
--- /dev/null
+++ b/couchdb/templates/clustersetup.yaml
@@ -0,0 +1,74 @@
+---
+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
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


[couchdb-helm] 01/03: Bump version

Posted by fl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

flimzy pushed a commit to branch clusterSetup
in repository https://gitbox.apache.org/repos/asf/couchdb-helm.git

commit c1f0132a936197ae92aafcf442ac85ff8c36eedb
Author: Jonathan Hall <fl...@flimzy.com>
AuthorDate: Fri Sep 18 16:09:51 2020 +0200

    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


[couchdb-helm] 03/03: Update documentation

Posted by fl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

flimzy pushed a commit to branch clusterSetup
in repository https://gitbox.apache.org/repos/asf/couchdb-helm.git

commit ed30b9f403c61fabb5f1dd39271866d913816b3b
Author: Jonathan Hall <fl...@flimzy.com>
AuthorDate: Mon Sep 21 15:34:23 2020 +0200

    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