Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add service.labels and fix ingress service reference #95

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add service.labels and fix ingress service reference
The ingress was mistakenly pointed to the headless service required for maintaining the statefulset. This means that `service.annotations`, etc. were not useful for controlling ingress behavior.

It might be desirable to change service names at some point to indicate which is headless / internal. However, that could be a disruptive action to any existing environments.
  • Loading branch information
colearendt committed Dec 16, 2022
commit 5b5f55883bf525efad868089e0b0a0d40d66e18d
2 changes: 1 addition & 1 deletion couchdb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: couchdb
version: 3.6.3
version: 3.6.4
appVersion: 3.2.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
Expand Down
12 changes: 12 additions & 0 deletions couchdb/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# NEWS

# 3.6.4

- Add `service.labels` value to pass along labels to the client-facing service
- Update `ingress` to use the service created by `service.enabled=true`,
instead of the headless service
([#94](https://github.com/apache/couchdb-helm/issues/94))
- This allows setting `service.annotations`, `service.labels`, etc. in a way that will be picked up by the ingress

# 3.6.3

- Add PersistentVolume annotations

## 3.6.2

- Change the `erlangCookie` to be auto-generated in a stateful fashion (i.e. we auto-generate it once, then leave that
Expand Down
12 changes: 6 additions & 6 deletions couchdb/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CouchDB

![Version: 3.6.1](https://img.shields.io/badge/Version-3.6.1-informational?style=flat-square) ![AppVersion: 3.2.1](https://img.shields.io/badge/AppVersion-3.2.1-informational?style=flat-square)
![Version: 3.6.4](https://img.shields.io/badge/Version-3.6.4-informational?style=flat-square) ![AppVersion: 3.2.1](https://img.shields.io/badge/AppVersion-3.2.1-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
Expand All @@ -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=3.6.1 \
--version=3.6.4 \
--set allowAdminParty=true \
--set couchdbConfig.couchdb.uuid=$(curl https://www.uuidgenerator.net/api/version4 2>/dev/null | tr -d -)
```
Expand All @@ -44,7 +44,7 @@ Afterwards install the chart replacing the UUID
```bash
$ helm install \
--name my-release \
--version=3.6.1 \
--version=3.6.4 \
--set couchdbConfig.couchdb.uuid=decafbaddecafbaddecafbaddecafbad \
couchdb/couchdb
```
Expand Down Expand Up @@ -85,7 +85,7 @@ and then install the chart while overriding the `createAdminSecret` setting:
```bash
$ helm install \
--name my-release \
--version=3.6.1 \
--version=3.6.4 \
--set createAdminSecret=false \
--set couchdbConfig.couchdb.uuid=decafbaddecafbaddecafbaddecafbad \
couchdb/couchdb
Expand Down Expand Up @@ -121,7 +121,7 @@ upgrade as follows:

```bash
$ helm upgrade <release-name> \
--version=3.6.1 \
--version=3.6.4 \
--reuse-values \
--set couchdbConfig.couchdb.uuid=<UUID> \
couchdb/couchdb
Expand All @@ -134,7 +134,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=3.6.1 couchdb/couchdb
$ helm upgrade my-release --version=3.6.4 couchdb/couchdb
```

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion couchdb/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "couchdb.fullname" . -}}
{{- $serviceName := include "couchdb.svcname" . -}}
{{- $servicePort := .Values.service.externalPort -}}
{{- $path := .Values.ingress.path | quote -}}
apiVersion: networking.k8s.io/v1
Expand Down
9 changes: 6 additions & 3 deletions couchdb/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ metadata:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.service.annotations }}
{{- with .Values.service.labels }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
{{- . | toYaml | nindent 4 }}
{{- end }}
spec:
ports:
- port: {{ .Values.service.externalPort }}
Expand Down
3 changes: 2 additions & 1 deletion couchdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ tolerations: []
## chart without any additional configuration. The Service block below refers
## to a second Service that governs how clients connect to the CouchDB cluster.
service:
# annotations:
annotations: {}
enabled: true
type: ClusterIP
externalPort: 5984
labels: {}

## An Ingress resource can provide name-based virtual hosting and TLS
## termination among other things for CouchDB deployments which are accessed
Expand Down