Skip to content
Permalink
Browse files
Require a server instance UUID (#15)
Requires `couchdbConfig.couchdb.uuid` to be set and fails helm install otherwise.

The option is mandatory since replication issues (See apache/couchdb#2298) can occur when all instances have different UUIDs which is what happens when couchdbConfig.couchdb.uuid is not set.

This is a major version bump as it requires upgrades to explicitly set this option.
  • Loading branch information
arnediekmann authored and willholley committed Nov 20, 2019
1 parent f2d5661 commit b46f424fbaa36291b1bc6c6a4e1751e5de7ce064
Showing 9 changed files with 89 additions and 11 deletions.
@@ -1,6 +1,6 @@
apiVersion: v1
name: couchdb
version: 2.4.1
version: 3.0.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
@@ -15,7 +15,9 @@ storage volumes to each Pod in the Deployment.

```bash
$ helm repo add couchdb https://apache.github.io/couchdb-helm
$ helm install couchdb/couchdb --set allowAdminParty=true
$ helm install couchdb/couchdb \
--set allowAdminParty=true \
--set couchdbConfig.couchdb.uuid=$(curl https://www.uuidgenerator.net/api/version4 2>/dev/null | tr -d -)
```

## Prerequisites
@@ -33,9 +35,14 @@ Add the CouchDB Helm repository:
$ helm repo add couchdb https://apache.github.io/couchdb-helm
```

Afterwards install the chart replacing the UUID
`decafbaddecafbaddecafbaddecafbad` with a custom one:

```bash
$ helm install --name my-release couchdb/couchdb
$ helm install \
--name my-release \
--set couchdbConfig.couchdb.uuid=decafbaddecafbaddecafbaddecafbad \
couchdb/couchdb
```

This will create a Secret containing the admin credentials for the cluster.
@@ -55,7 +62,11 @@ $ kubectl create secret generic my-release-couchdb --from-literal=adminUsername
and then install the chart while overriding the `createAdminSecret` setting:

```bash
$ helm install --name my-release --set createAdminSecret=false couchdb/couchdb
$ helm install \
--name my-release \
--set createAdminSecret=false \
--set couchdbConfig.couchdb.uuid=decafbaddecafbaddecafbaddecafbad \
couchdb/couchdb
```

This Helm chart deploys CouchDB on the Kubernetes cluster in a default
@@ -80,6 +91,19 @@ deletes the release.
A major chart version change (like v0.2.3 -> v1.0.0) indicates that there is an
incompatible breaking change needing manual actions.

### Upgrade to 3.0.0

Since version 3.0.0 setting the CouchDB server instance UUID is mandatory.
Therefore you need to generate a UUID and supply it as a value during the
upgrade as follows:

```bash
$ helm upgrade <release-name> \
--reuse-values \
--set couchdbConfig.couchdb.uuid=<UUID> \
couchdb/couchdb
```

## Migrating from stable/couchdb

This chart replaces the `stable/couchdb` chart previously hosted by Helm and continues the
@@ -98,7 +122,7 @@ CouchDB chart and their default values:
| Parameter | Description | Default |
|---------------------------------|-------------------------------------------------------|----------------------------------------|
| `clusterSize` | The initial number of nodes in the CouchDB cluster | 3 |
| `couchdbConfig` | Map allowing override elements of server .ini config | chttpd.bind_address=any |
| `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 |
| `schedulerName` | Name of the k8s scheduler (other than default) | `nil` |
@@ -107,6 +131,16 @@ CouchDB chart and their default values:
| `persistentVolume.size` | If enabled, the size of the persistent volume to attach | 10Gi
| `enableSearch` | Adds a sidecar for Lucene-powered text search | false |

You can set the values of the `couchdbConfig` map according to the
[official configuration][4]. The following shows the map's default values and
required options to set:

| Parameter | Description | Default |
|---------------------------------|--------------------------------------------------------------------|----------------------------------------|
| `couchdb.uuid` | UUID for this CouchDB server instance ([Required in a cluster][5]) | |
| `chttpd.bind_address` | listens on all interfaces when set to any | any |
| `chttpd.require_valid_user` | disables all the anonymous requests to the port 5984 when true | false |

A variety of other parameters are also configurable. See the comments in the
`values.yaml` file for further details:

@@ -175,3 +209,5 @@ use GitHub Issues, do not report anything on Docker's website.
[1]: http://mail-archives.apache.org/mod_mbox/couchdb-user/
[2]: http://mail-archives.apache.org/mod_mbox/couchdb-dev/
[3]: https://github.com/apache/couchdb/blob/master/CONTRIBUTING.md
[4]: https://docs.couchdb.org/en/stable/config/index.html
[5]: https://docs.couchdb.org/en/latest/setup/cluster.html#preparing-couchdb-nodes-to-be-joined-into-a-cluster
@@ -0,0 +1,3 @@
couchdbConfig:
couchdb:
uuid: "decafbaddecafbaddecafbaddecafbad"
@@ -72,3 +72,10 @@ If serviceAccount.name is specified, use that, else use the couchdb instance nam
{{- template "couchdb.fullname" . -}}
{{- end -}}
{{- end -}}

{{/*
Fail if couchdbConfig.couchdb.uuid is undefined
*/}}
{{- define "couchdb.uuid" -}}
{{- required "A value for couchdbConfig.couchdb.uuid must be set" (.Values.couchdbConfig.couchdb | default dict).uuid -}}
{{- end -}}
@@ -9,7 +9,9 @@ metadata:
release: {{ .Release.Name | quote }}
data:
inifile: |
{{ range $section, $settings := .Values.couchdbConfig -}}
{{ $couchdbConfig := dict "couchdb" (dict "uuid" (include "couchdb.uuid" .)) -}}
{{- $couchdbConfig := merge $couchdbConfig .Values.couchdbConfig -}}
{{- range $section, $settings := $couchdbConfig -}}
{{ printf "[%s]" $section }}
{{ range $key, $value := $settings -}}
{{ printf "%s = %s" $key ($value | toString) }}
@@ -150,6 +150,8 @@ erlangFlags:
## by a ConfigMap object.
## ref: http://docs.couchdb.org/en/latest/config/index.html
couchdbConfig:
# couchdb:
# uuid: decafbaddecafbaddecafbaddecafbad # Unique identifier for this CouchDB server instance
# cluster:
# q: 8 # Create 8 shards for each database
chttpd:
BIN +8.32 KB docs/couchdb-3.0.0.tgz
Binary file not shown.
@@ -3,7 +3,30 @@ entries:
couchdb:
- apiVersion: v1
appVersion: 2.3.1
created: "2019-11-01T11:51:15.339935463+01:00"
created: "2019-11-20T17:05:05.503189523+01:00"
description: A database featuring seamless multi-master sync, that scales from
big data to mobile, with an intuitive HTTP/JSON API and designed for reliability.
digest: 7770f1c19e948d9928eeed4f11ff960e598149bb5c0ae3e1f546b61e9dfb65f4
home: https://couchdb.apache.org/
icon: http://couchdb.apache.org/CouchDB-visual-identity/logo/CouchDB-couch-symbol.svg
keywords:
- couchdb
- database
- nosql
maintainers:
- email: kocolosk@apache.org
name: kocolosk
- email: willholley@apache.org
name: willholley
name: couchdb
sources:
- https://github.com/apache/couchdb-docker
urls:
- https://apache.github.io/couchdb-helm/couchdb-3.0.0.tgz
version: 3.0.0
- apiVersion: v1
appVersion: 2.3.1
created: "2019-11-20T17:05:05.500168632+01:00"
description: A database featuring seamless multi-master sync, that scales from
big data to mobile, with an intuitive HTTP/JSON API and designed for reliability.
digest: db0815c2766f76049b58d0954b66e0b70bf673a7d11c1d3cd9e07c775c646c12
@@ -26,7 +49,7 @@ entries:
version: 2.4.1
- apiVersion: v1
appVersion: 2.3.1
created: "2019-11-01T11:51:15.339429507+01:00"
created: "2019-11-20T17:05:05.499725352+01:00"
description: A database featuring seamless multi-master sync, that scales from
big data to mobile, with an intuitive HTTP/JSON API and designed for reliability.
digest: daddf6cc7fe8bb63d6fa8679565d4496d92c23d9ff85b19521fca74c6412bc11
@@ -49,7 +72,7 @@ entries:
version: 2.4.0
- apiVersion: v1
appVersion: 2.3.1
created: "2019-11-01T11:51:15.333646851+01:00"
created: "2019-11-20T17:05:05.499039305+01:00"
description: A database featuring seamless multi-master sync, that scales from
big data to mobile, with an intuitive HTTP/JSON API and designed for reliability.
digest: 0eba7c20ec47bc8556b3cb3b5137b578d46b37397493087d61b8199066f84782
@@ -72,7 +95,7 @@ entries:
version: 2.3.0
- apiVersion: v1
appVersion: 2.3.1
created: "2019-11-01T11:51:15.330535744+01:00"
created: "2019-11-20T17:05:05.498407349+01:00"
description: A database featuring seamless multi-master sync, that scales from
big data to mobile, with an intuitive HTTP/JSON API and designed for reliability.
digest: f68e6187c2b65a02fdde9d49ec38e76a68c3d82421e5ea9e599bac87f4193c6a
@@ -93,4 +116,4 @@ entries:
urls:
- https://apache.github.io/couchdb-helm/couchdb-2.2.0.tgz
version: 2.2.0
generated: "2019-11-01T11:51:15.321186109+01:00"
generated: "2019-11-20T17:05:05.497677063+01:00"
@@ -0,0 +1,5 @@
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker

0 comments on commit b46f424

Please sign in to comment.