Bump chart to 3.4.0  CouchDB to 3.2.0

- add support for built-in prometheus metrics

Signed-off-by: Stephen Gregory <stephen@epsilon3.io>
diff --git a/couchdb/Chart.yaml b/couchdb/Chart.yaml
index ae44bf2..5df25e4 100644
--- a/couchdb/Chart.yaml
+++ b/couchdb/Chart.yaml
@@ -1,7 +1,7 @@
 apiVersion: v1
 name: couchdb
-version: 3.3.4
-appVersion: 3.1.1
+version: 3.4.0
+appVersion: 3.2.0
 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.
diff --git a/couchdb/README.md b/couchdb/README.md
index dcec920..037641d 100644
--- a/couchdb/README.md
+++ b/couchdb/README.md
@@ -168,7 +168,7 @@
 | `adminHash`                          |                                        |
 | `cookieAuthSecret`                   | auto-generated                         |
 | `image.repository`                   | couchdb                                |
-| `image.tag`                          | 3.1.1                                  |
+| `image.tag`                          | 3.2.0                                  |
 | `image.pullPolicy`                   | IfNotPresent                           |
 | `searchImage.repository`             | kocolosk/couchdb-search                |
 | `searchImage.tag`                    | 0.1.0                                  |
@@ -210,7 +210,9 @@
 | `readinessProbe.periodSeconds`       | 10                                     |
 | `readinessProbe.successThreshold`    | 1                                      |
 | `readinessProbe.timeoutSeconds`      | 1                                      |
-
+| `prometheusPort.enabled`             | false                                  |
+| `prometheusPort.port`                | 17896                                  |
+| `prometheusPort.bind_address`        | 0.0.0.0                                |
 ## Feedback, Issues, Contributing
 
 General feedback is welcome at our [user][1] or [developer][2] mailing lists.
diff --git a/couchdb/templates/configmap.yaml b/couchdb/templates/configmap.yaml
index a6a20e0..55bbf3b 100644
--- a/couchdb/templates/configmap.yaml
+++ b/couchdb/templates/configmap.yaml
@@ -21,3 +21,11 @@
   seedlistinifile: |
     [cluster]
     seedlist = {{ template "couchdb.seedlist" . }}
+
+{{- if .Values.prometheusPort.enabled }}
+  prometheusinifile: |
+    [prometheus]
+    additional_port = {{ .Values.prometheusPort.enabled }}
+    bind_address = {{ .Values.prometheusPort.bind_address }}
+    port = {{ .Values.prometheusPort.port }}
+{{- end }}
diff --git a/couchdb/templates/headless.yaml b/couchdb/templates/headless.yaml
index 0ce3ef0..68659dc 100644
--- a/couchdb/templates/headless.yaml
+++ b/couchdb/templates/headless.yaml
@@ -13,5 +13,9 @@
   ports:
     - name: couchdb
       port: 5984
+{{- if .Values.prometheusPort.enabled }}
+    - name: metrics
+      port: {{ .Values.prometheusPort.port }}
+{{- end }}
   selector:
 {{ include "couchdb.ss.selector" . | indent 4 }}
diff --git a/couchdb/templates/networkpolicy.yaml b/couchdb/templates/networkpolicy.yaml
index 2830708..2fd2926 100644
--- a/couchdb/templates/networkpolicy.yaml
+++ b/couchdb/templates/networkpolicy.yaml
@@ -17,6 +17,10 @@
     - ports:
         - protocol: TCP
           port: 5984
+{{- if .Values.prometheusPort.enabled }}
+        - protocol: TCP
+          port: {{ .Values.prometheusPort.port }}
+{{- end }}
     - ports:
         - protocol: TCP
           port: 9100
diff --git a/couchdb/templates/statefulset.yaml b/couchdb/templates/statefulset.yaml
index 6225fbe..40b0b86 100644
--- a/couchdb/templates/statefulset.yaml
+++ b/couchdb/templates/statefulset.yaml
@@ -34,7 +34,14 @@
         - name: init-copy
           image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}"
           imagePullPolicy: {{ .Values.initImage.pullPolicy }}
-          command: ['sh','-c','cp /tmp/chart.ini /default.d; cp /tmp/seedlist.ini /default.d; ls -lrt /default.d;']
+          command: 
+            - 'sh'
+            - '-c'
+{{- if .Values.prometheusPort.enabled }}
+            - 'cp /tmp/chart.ini /default.d; cp /tmp/seedlist.ini /default.d; cp /tmp/prometheus.ini /default.d; ls -lrt /default.d;'
+{{- else }}
+            - 'cp /tmp/chart.ini /default.d; cp /tmp/seedlist.ini /default.d; ls -lrt /default.d;'
+{{- end }}
           volumeMounts:
           - name: config
             mountPath: /tmp/
@@ -62,6 +69,10 @@
             - name: epmd
               containerPort: 4369
             - containerPort: 9100
+{{- if .Values.prometheusPort.enabled }}
+            - name: metrics
+              containerPort: {{ .Values.prometheusPort.port }}
+{{- end }}
           env:
 {{- if not .Values.allowAdminParty }}
             - name: COUCHDB_USER
@@ -165,6 +176,10 @@
                 path: chart.ini
               - key: seedlistinifile
                 path: seedlist.ini
+{{- if .Values.prometheusPort.enabled }}
+              - key: prometheusinifile 
+                path: prometheus.ini
+{{- end }}
 
 {{- if .Values.adminHash }}
         - name: local-config-storage
diff --git a/couchdb/values.yaml b/couchdb/values.yaml
index 07f60d8..787be28 100644
--- a/couchdb/values.yaml
+++ b/couchdb/values.yaml
@@ -60,7 +60,7 @@
 ## The CouchDB image
 image:
   repository: couchdb
-  tag: 3.1.1
+  tag: 3.2.0
   pullPolicy: IfNotPresent
 
 ## Experimental integration with Lucene-powered fulltext search
@@ -189,6 +189,13 @@
   successThreshold: 1
   timeoutSeconds: 1
 
+# CouchDB 3.2.0 adds in a metrics endpoint on the path `/_node/_local/_prometheus`.
+# Optionally, a standalone, unauthenticated port can be exposed for these metrics.
+prometheusPort:
+  enabled: false
+  bind_address: "0.0.0.0"
+  port: 17986
+
 # Configure arbitrary sidecar containers for CouchDB pods created by the
 # StatefulSet
 sidecars: {}
diff --git a/docs/couchdb-3.4.0.tgz b/docs/couchdb-3.4.0.tgz
new file mode 100644
index 0000000..3fcb6fc
--- /dev/null
+++ b/docs/couchdb-3.4.0.tgz
Binary files differ
diff --git a/docs/index.yaml b/docs/index.yaml
index f737598..81d854c 100644
--- a/docs/index.yaml
+++ b/docs/index.yaml
@@ -2,6 +2,29 @@
 entries:
   couchdb:
   - apiVersion: v1
+    appVersion: 3.2.0
+    created: "2021-11-01T11:58:35.829781-04: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: f02403a6e33116ca8ac7d4cf438e6fd449628be2624c54e4fab4598b368a99f8
+    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.4.0.tgz
+    version: 3.4.0
+  - apiVersion: v1
     appVersion: 3.1.1
     created: "2021-07-19T17:06:48.703104-04:00"
     description: A database featuring seamless multi-master sync, that scales from
@@ -277,4 +300,4 @@
     urls:
     - https://apache.github.io/couchdb-helm/couchdb-2.2.0.tgz
     version: 2.2.0
-generated: "2021-07-19T17:06:48.70203-04:00"
+generated: "2021-11-01T11:58:35.8284-04:00"