Support extraPorts in the service template. (#154)

* Support extraPorts in the service template.
* Support extraPorts on the StatefulSet.
* Update documentation for extraPorts.
diff --git a/couchdb/Chart.yaml b/couchdb/Chart.yaml
index 0317803..cb44e7b 100644
--- a/couchdb/Chart.yaml
+++ b/couchdb/Chart.yaml
@@ -1,6 +1,6 @@
 apiVersion: v1
 name: couchdb
-version: 4.5.3
+version: 4.5.4
 appVersion: 3.3.3
 description: A database featuring seamless multi-master sync, that scales from
   big data to mobile, with an intuitive HTTP/JSON API and designed for
diff --git a/couchdb/NEWS.md b/couchdb/NEWS.md
index 99a6c2e..a723e55 100644
--- a/couchdb/NEWS.md
+++ b/couchdb/NEWS.md
@@ -1,8 +1,12 @@
 # NEWS
 
+## 4.5.4
+
+- Expose `extraPorts` and `service.extraPorts` to allow specifying arbitrary ports to be exposed from the CouchDB pods
+
 ## 4.5.3
 
-- Fix ability to define pull secrets using `imagePullSecrets`. 
+- Fix ability to define pull secrets using `imagePullSecrets`.
 
 ## 4.5.2
 
diff --git a/couchdb/README.md b/couchdb/README.md
index 98b2572..5ddefaa 100644
--- a/couchdb/README.md
+++ b/couchdb/README.md
@@ -171,6 +171,7 @@
 | `adminPassword`                      | auto-generated                                   |
 | `adminHash`                          |                                                  |
 | `cookieAuthSecret`                   | auto-generated                                   |
+| `extraPorts`                         | [] (a list of ContainerPort objects)             |
 | `image.repository`                   | couchdb                                          |
 | `image.tag`                          | 3.3.3                                            |
 | `image.pullPolicy`                   | IfNotPresent                                     |
@@ -218,6 +219,7 @@
 | `service.type`                       | ClusterIP                                        |
 | `service.externalPort`               | 5984                                             |
 | `service.targetPort`                 | 5984                                             |
+| `service.extraPorts`                 | [] (a list of ServicePort objects)               |
 | `dns.clusterDomainSuffix`            | cluster.local                                    |
 | `networkPolicy.enabled`              | true                                             |
 | `serviceAccount.enabled`             | true                                             |
diff --git a/couchdb/templates/service.yaml b/couchdb/templates/service.yaml
index 4f2665d..815d47c 100644
--- a/couchdb/templates/service.yaml
+++ b/couchdb/templates/service.yaml
@@ -20,6 +20,9 @@
     - port: {{ .Values.service.externalPort }}
       protocol: TCP
       targetPort: {{ .Values.service.targetPort }}
+    {{ with .Values.service.extraPorts }}
+    {{- toYaml . | nindent 4 }}
+    {{- end }}
   type: {{ .Values.service.type }}
   selector:
 {{ include "couchdb.ss.selector" . | indent 4 }}
diff --git a/couchdb/templates/statefulset.yaml b/couchdb/templates/statefulset.yaml
index 587fa6a..5686f1c 100644
--- a/couchdb/templates/statefulset.yaml
+++ b/couchdb/templates/statefulset.yaml
@@ -101,6 +101,9 @@
             - name: metrics
               containerPort: {{ .Values.prometheusPort.port }}
 {{- end }}
+{{ with .Values.extraPorts }}
+{{ toYaml . | indent 12 }}
+{{ end }}
           env:
 {{- if not .Values.allowAdminParty }}
             - name: COUCHDB_USER
diff --git a/couchdb/values.yaml b/couchdb/values.yaml
index cf4b5ce..586dc54 100644
--- a/couchdb/values.yaml
+++ b/couchdb/values.yaml
@@ -154,6 +154,18 @@
   externalPort: 5984
   targetPort: 5984
   labels: {}
+  extraPorts: []
+  # - name: sqs
+  #   port: 4984
+  #   targetPort: 4984
+  #   protocol: TCP
+
+## If you need to expose any additional ports on the CouchDB container, for example
+## if you're running CouchDB container with additional processes that need to
+## be accessible outside of the pod, you can define them here.
+extraPorts: []
+  # - name: sqs
+  #   containerPort: 4984
 
 ## An Ingress resource can provide name-based virtual hosting and TLS
 ## termination among other things for CouchDB deployments which are accessed