diff --git a/.gitignore b/.gitignore index 1377554..7eb818b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.swp +*.tgz +.idea/ \ No newline at end of file diff --git a/couchdb/Chart.yaml b/couchdb/Chart.yaml index fbe0bfe..1a897bc 100644 --- a/couchdb/Chart.yaml +++ b/couchdb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: couchdb -version: 4.5.6 +version: 4.5.7 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 af0dd8a..6c39b2a 100644 --- a/couchdb/NEWS.md +++ b/couchdb/NEWS.md @@ -1,5 +1,12 @@ # NEWS +## 4.5.7 + +- Add `extraEnvVars` to the `couchdb` container in the StatefulSet. +- Add `extraVolumeMounts` to the `couchdb` container in the StatefulSet +- Add `extraVolumes` to the StatefulSet +- Add `extraInitContainers` to the StatefulSet + ## 4.5.6 - Add `extraPorts` to the network policy when the network policy is enabled. diff --git a/couchdb/README.md b/couchdb/README.md index 5ddefaa..930f8b2 100644 --- a/couchdb/README.md +++ b/couchdb/README.md @@ -1,6 +1,6 @@ # CouchDB -![Version: 4.5.3](https://img.shields.io/badge/Version-4.5.3-informational?style=flat-square) ![AppVersion: 3.3.3](https://img.shields.io/badge/AppVersion-3.3.3-informational?style=flat-square) +![Version: 4.5.7](https://img.shields.io/badge/Version-4.5.7-informational?style=flat-square) ![AppVersion: 3.3.3](https://img.shields.io/badge/AppVersion-3.3.3-informational?style=flat-square) Apache CouchDB is a database featuring seamless multi-master sync, that scales from big data to mobile, with an intuitive HTTP/JSON API and designed for @@ -18,7 +18,7 @@ storage volumes to each Pod in the Deployment. ```bash $ helm repo add couchdb https://apache.github.io/couchdb-helm $ helm install couchdb/couchdb \ - --version=4.5.3 \ + --version=4.5.7 \ --set allowAdminParty=true \ --set couchdbConfig.couchdb.uuid=$(curl https://www.uuidgenerator.net/api/version4 2>/dev/null | tr -d -) ``` @@ -44,7 +44,7 @@ Afterwards install the chart replacing the UUID ```bash $ helm install \ --name my-release \ - --version=4.5.3 \ + --version=4.5.7 \ --set couchdbConfig.couchdb.uuid=decafbaddecafbaddecafbaddecafbad \ couchdb/couchdb ``` @@ -78,7 +78,7 @@ and then install the chart while overriding the `createAdminSecret` setting: ```bash $ helm install \ --name my-release \ - --version=4.5.3 \ + --version=4.5.7 \ --set createAdminSecret=false \ --set couchdbConfig.couchdb.uuid=decafbaddecafbaddecafbaddecafbad \ couchdb/couchdb @@ -133,7 +133,7 @@ version semantics. You can upgrade directly from `stable/couchdb` to this chart ```bash $ helm repo add couchdb https://apache.github.io/couchdb-helm -$ helm upgrade my-release --version=4.5.3 couchdb/couchdb +$ helm upgrade my-release --version=4.5.7 couchdb/couchdb ``` ## Configuration @@ -165,87 +165,91 @@ A variety of other parameters are also configurable. See the comments in the `values.yaml` file for further details: -| Parameter | Default | -|--------------------------------------| ------------------------------------------------ | -| `adminUsername` | admin | -| `adminPassword` | auto-generated | -| `adminHash` | | -| `cookieAuthSecret` | auto-generated | -| `extraPorts` | [] (a list of ContainerPort objects) | -| `image.repository` | couchdb | -| `image.tag` | 3.3.3 | -| `image.pullPolicy` | IfNotPresent | -| `searchImage.repository` | kocolosk/couchdb-search | -| `searchImage.tag` | 0.1.0 | -| `searchImage.pullPolicy` | IfNotPresent | -| `initImage.repository` | busybox | -| `initImage.tag` | latest | -| `initImage.pullPolicy` | Always | -| `ingress.enabled` | false | -| `ingress.className` | | -| `ingress.hosts` | chart-example.local | -| `ingress.annotations` | | -| `ingress.path` | / | -| `ingress.tls` | | -| `persistentVolume.accessModes` | ReadWriteOnce | -| `persistentVolume.storageClass` | Default for the Kube cluster | -| `persistentVolume.annotations` | {} | -| `persistentVolume.existingClaims` | [] (a list of existing PV/PVC volume value objects with `volumeName`, `claimName`, `persistentVolumeName` and `volumeSource` defined) | -| `persistentVolume.volumeName` | | -| `persistentVolume.claimName` | | -| `persistentVolume.volumeSource` | | -| `persistentVolume.annotations` | {} | -| `persistentVolumeClaimRetentionPolicy.enabled` | Field controls if and how PVCs are deleted during the lifecycle | -| `persistentVolumeClaimRetentionPolicy.whenScaled` | Configures the volume retention behavior that applies when the replica count of the StatefulSet is reduced | -| `persistentVolumeClaimRetentionPolicy.whenDeleted` | Configures the volume retention behavior that applies when the StatefulSet is deleted | -| `podDisruptionBudget.enabled` | false | -| `podDisruptionBudget.minAvailable` | nil | -| `podDisruptionBudget.maxUnavailable` | 1 | -| `podManagementPolicy` | Parallel | -| `affinity` | | -| `topologySpreadConstraints` | | -| `labels` | | -| `annotations` | | -| `tolerations` | | -| `resources` | | -| `initResources` | | -| `autoSetup.enabled` | false (if set to true, must have `service.enabled` set to true and a correct `adminPassword` - deploy it with the `--wait` flag to avoid first jobs failure) | -| `autoSetup.image.repository` | curlimages/curl | -| `autoSetup.image.tag` | latest | -| `autoSetup.image.pullPolicy` | Always | -| `autoSetup.defaultDatabases` | [`_global_changes`] | -| `service.annotations` | | -| `service.enabled` | true | -| `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 | -| `serviceAccount.create` | true | -| `imagePullSecrets` | | -| `sidecars` | {} | -| `livenessProbe.enabled` | true | -| `livenessProbe.failureThreshold` | 3 | -| `livenessProbe.initialDelaySeconds` | 0 | -| `livenessProbe.periodSeconds` | 10 | -| `livenessProbe.successThreshold` | 1 | -| `livenessProbe.timeoutSeconds` | 1 | -| `readinessProbe.enabled` | true | -| `readinessProbe.failureThreshold` | 3 | -| `readinessProbe.initialDelaySeconds` | 0 | -| `readinessProbe.periodSeconds` | 10 | -| `readinessProbe.successThreshold` | 1 | -| `readinessProbe.timeoutSeconds` | 1 | -| `prometheusPort.enabled` | false | -| `prometheusPort.port` | 17896 | -| `prometheusPort.bind_address` | 0.0.0.0 | -| `placementConfig.enabled` | false | -| `placementConfig.image.repository` | caligrafix/couchdb-autoscaler-placement-manager | -| `placementConfig.image.tag` | 0.1.0 | -| `podSecurityContext` | | -| `containerSecurityContext` | | +| Parameter | Default | +|----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `adminUsername` | admin | +| `adminPassword` | auto-generated | +| `adminHash` | | +| `cookieAuthSecret` | auto-generated | +| `extraPorts` | [] (a list of ContainerPort objects) | +| `image.repository` | couchdb | +| `image.tag` | 3.3.3 | +| `image.pullPolicy` | IfNotPresent | +| `searchImage.repository` | kocolosk/couchdb-search | +| `searchImage.tag` | 0.1.0 | +| `searchImage.pullPolicy` | IfNotPresent | +| `initImage.repository` | busybox | +| `initImage.tag` | latest | +| `initImage.pullPolicy` | Always | +| `extraInitContainers` | [] | +| `ingress.enabled` | false | +| `ingress.className` | | +| `ingress.hosts` | chart-example.local | +| `ingress.annotations` | | +| `ingress.path` | / | +| `ingress.tls` | | +| `persistentVolume.accessModes` | ReadWriteOnce | +| `persistentVolume.storageClass` | Default for the Kube cluster | +| `persistentVolume.annotations` | {} | +| `persistentVolume.existingClaims` | [] (a list of existing PV/PVC volume value objects with `volumeName`, `claimName`, `persistentVolumeName` and `volumeSource` defined) | +| `persistentVolume.volumeName` | | +| `persistentVolume.claimName` | | +| `persistentVolume.volumeSource` | | +| `persistentVolume.annotations` | {} | +| `persistentVolumeClaimRetentionPolicy.enabled` | Field controls if and how PVCs are deleted during the lifecycle | +| `persistentVolumeClaimRetentionPolicy.whenScaled` | Configures the volume retention behavior that applies when the replica count of the StatefulSet is reduced | +| `persistentVolumeClaimRetentionPolicy.whenDeleted` | Configures the volume retention behavior that applies when the StatefulSet is deleted | +| `podDisruptionBudget.enabled` | false | +| `podDisruptionBudget.minAvailable` | nil | +| `podDisruptionBudget.maxUnavailable` | 1 | +| `podManagementPolicy` | Parallel | +| `affinity` | | +| `topologySpreadConstraints` | | +| `labels` | | +| `annotations` | | +| `tolerations` | | +| `resources` | | +| `initResources` | | +| `autoSetup.enabled` | false (if set to true, must have `service.enabled` set to true and a correct `adminPassword` - deploy it with the `--wait` flag to avoid first jobs failure) | +| `autoSetup.image.repository` | curlimages/curl | +| `autoSetup.image.tag` | latest | +| `autoSetup.image.pullPolicy` | Always | +| `autoSetup.defaultDatabases` | [`_global_changes`] | +| `service.annotations` | | +| `service.enabled` | true | +| `service.type` | ClusterIP | +| `service.externalPort` | 5984 | +| `service.targetPort` | 5984 | +| `service.extraPorts` | [] (a list of ServicePort objects) | +| `extraEnvVars` | [] | +| `extraVolumeMounts` | [] | +| `extraVolumes` | [] | +| `dns.clusterDomainSuffix` | cluster.local | +| `networkPolicy.enabled` | true | +| `serviceAccount.enabled` | true | +| `serviceAccount.create` | true | +| `imagePullSecrets` | | +| `sidecars` | {} | +| `livenessProbe.enabled` | true | +| `livenessProbe.failureThreshold` | 3 | +| `livenessProbe.initialDelaySeconds` | 0 | +| `livenessProbe.periodSeconds` | 10 | +| `livenessProbe.successThreshold` | 1 | +| `livenessProbe.timeoutSeconds` | 1 | +| `readinessProbe.enabled` | true | +| `readinessProbe.failureThreshold` | 3 | +| `readinessProbe.initialDelaySeconds` | 0 | +| `readinessProbe.periodSeconds` | 10 | +| `readinessProbe.successThreshold` | 1 | +| `readinessProbe.timeoutSeconds` | 1 | +| `prometheusPort.enabled` | false | +| `prometheusPort.port` | 17896 | +| `prometheusPort.bind_address` | 0.0.0.0 | +| `placementConfig.enabled` | false | +| `placementConfig.image.repository` | caligrafix/couchdb-autoscaler-placement-manager | +| `placementConfig.image.tag` | 0.1.0 | +| `podSecurityContext` | | +| `containerSecurityContext` | | ## Feedback, Issues, Contributing diff --git a/couchdb/requirements.lock b/couchdb/requirements.lock new file mode 100644 index 0000000..89e2fb2 --- /dev/null +++ b/couchdb/requirements.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: oci://registry-1.docker.io/bitnamicharts + version: 2.20.4 +digest: sha256:73045308add144761f12bc13cbad9fddcdce25c6919140e0683d18622bf56ba0 +generated: "2024-07-12T14:35:04.405255+02:00" diff --git a/couchdb/requirements.yaml b/couchdb/requirements.yaml new file mode 100644 index 0000000..d9f7e0f --- /dev/null +++ b/couchdb/requirements.yaml @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: oci://registry-1.docker.io/bitnamicharts + tags: + - bitnami-common + version: 2.x.x diff --git a/couchdb/templates/statefulset.yaml b/couchdb/templates/statefulset.yaml index 5686f1c..d928bae 100644 --- a/couchdb/templates/statefulset.yaml +++ b/couchdb/templates/statefulset.yaml @@ -87,6 +87,9 @@ spec: resources: {{ toYaml .Values.initResources | indent 12 }} {{- end }} + {{- if .Values.extraInitContainers }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraInitContainers "context" $) | nindent 8 }} + {{- end }} containers: - name: couchdb image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -129,6 +132,9 @@ spec: key: erlangCookie - name: ERL_FLAGS value: "{{ range $k, $v := .Values.erlangFlags }} -{{ $k }} {{ $v }} {{ end }}" +{{- if .Values.extraEnvVars }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} +{{- end }} {{- if .Values.livenessProbe.enabled }} livenessProbe: {{- if .Values.couchdbConfig.chttpd.require_valid_user }} @@ -178,6 +184,9 @@ spec: {{- end }} - name: database-storage mountPath: /opt/couchdb/data +{{- if .Values.extraVolumeMounts }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 10 }} +{{- end }} {{- if .Values.containerSecurityContext }} securityContext: {{ .Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} @@ -226,6 +235,9 @@ spec: - key: prometheusinifile path: prometheus.ini {{- end }} +{{- if .Values.extraVolumes }} + {{- include "common.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }} +{{- end }} {{- if .Values.adminHash }} - name: local-config-storage diff --git a/couchdb/values.yaml b/couchdb/values.yaml index 586dc54..fbc9b9e 100644 --- a/couchdb/values.yaml +++ b/couchdb/values.yaml @@ -105,6 +105,9 @@ initImage: tag: latest pullPolicy: Always +## Define extra init containers here. E.g. for copying custom configuration files +extraInitContainers: [] + ## CouchDB is happy to spin up cluster nodes in parallel, but if you encounter ## problems you can try setting podManagementPolicy to the StatefulSet default ## `OrderedReady` @@ -167,6 +170,25 @@ extraPorts: [] # - name: sqs # containerPort: 4984 +## Additional environment variables to set in the CouchDB container +extraEnvVars: [] + # - name: MY_ENV_VAR + # value: my-env-var-value + +## If you need to mount extra volumes on the CouchDB container +extraVolumeMounts: + # - name: limits-config + # mountPath: /etc/security/limits.d + +## Define extra volumes for the StatefulSet here +extraVolumes: + # - name: limits-config + # configMap: + # name: limits-config + # items: + # - key: 100-couchdb + # path: 100-couchdb.conf + ## An Ingress resource can provide name-based virtual hosting and TLS ## termination among other things for CouchDB deployments which are accessed ## from outside the Kubernetes cluster.