From 31a1e3bfd76d48c5624290d5b0fba0f1d103313d Mon Sep 17 00:00:00 2001 From: Jeremy Chabernaud Date: Mon, 8 Jul 2024 12:15:15 +0200 Subject: [PATCH] feat(nexus3): added service.additionalPorts.hosts for multi-hosts support (#982) feat(nexus3): added .service.additionalPorts.hosts for multi-hosts support Signed-off-by: djerfy --- charts/nexus3/CHANGELOG.md | 8 ++++++++ charts/nexus3/ci/ci-values.yaml | 9 +++++++++ charts/nexus3/ci/kubeconform.yaml | 10 +++++++--- charts/nexus3/templates/ingress.yaml | 10 ++++++---- charts/nexus3/values.yaml | 10 +++++++--- 5 files changed, 37 insertions(+), 10 deletions(-) diff --git a/charts/nexus3/CHANGELOG.md b/charts/nexus3/CHANGELOG.md index cef1854f..9429ecd1 100644 --- a/charts/nexus3/CHANGELOG.md +++ b/charts/nexus3/CHANGELOG.md @@ -14,6 +14,14 @@ ## [UNRELEASED] +### Added + +- Added `service.additionalPorts.hosts` (list) for multi-hosts support + +### Deprecated + +- Deprecated `service.additionalPorts.host` in favour of `service.additionalPorts.hosts` + ## [v4.44.0] - 2024-06-10 ### Changed diff --git a/charts/nexus3/ci/ci-values.yaml b/charts/nexus3/ci/ci-values.yaml index a838061c..fad55007 100644 --- a/charts/nexus3/ci/ci-values.yaml +++ b/charts/nexus3/ci/ci-values.yaml @@ -96,4 +96,13 @@ config: attributes: blobStoreName: "default" +service: + additionalPorts: + - port: 8083 + name: docker-hosted + containerPort: 8083 + hosts: + - nexus-docker-hosted-1.local + - nexus-docker-hosted-2.local + testResources: true diff --git a/charts/nexus3/ci/kubeconform.yaml b/charts/nexus3/ci/kubeconform.yaml index 5f723c50..9c7950a1 100644 --- a/charts/nexus3/ci/kubeconform.yaml +++ b/charts/nexus3/ci/kubeconform.yaml @@ -24,11 +24,14 @@ service: - port: 8082 name: docker-group containerPort: 8082 - host: nexus-docker.local + hosts: + - nexus-docker.local - port: 8083 name: docker-hosted containerPort: 8083 - host: nexus-docker-hosted.local + hosts: + - nexus-docker-hosted-1.local + - nexus-docker-hosted-2.local metrics: enabled: true @@ -50,7 +53,8 @@ ingress: - hosts: - nexus.local - nexus-docker.local - - nexus-docker-hosted.local + - nexus-docker-hosted-1.local + - nexus-docker-hosted-2.local secretName: nexus3-local-tls persistence: diff --git a/charts/nexus3/templates/ingress.yaml b/charts/nexus3/templates/ingress.yaml index 47aa4e71..f3c59dc4 100644 --- a/charts/nexus3/templates/ingress.yaml +++ b/charts/nexus3/templates/ingress.yaml @@ -37,8 +37,9 @@ spec: servicePort: http {{- end }} {{- end }} - {{- range .Values.service.additionalPorts }} - - host: {{ .host | quote }} + {{- range $additionalPort := .Values.service.additionalPorts }} + {{- range ternary $additionalPort.hosts (list $additionalPort.host) (empty $additionalPort.host) }} + - host: {{ . | quote }} http: paths: - path: / @@ -50,12 +51,13 @@ spec: service: name: {{ $serviceName }} port: - name: {{ .name }} + name: {{ $additionalPort.name }} {{- else }} serviceName: {{ $serviceName }} - servicePort: {{ .name }} + servicePort: {{ $additionalPort.name }} {{- end }} {{- end }} + {{- end }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} diff --git a/charts/nexus3/values.yaml b/charts/nexus3/values.yaml index 7ecfbc6c..89ba5fa4 100644 --- a/charts/nexus3/values.yaml +++ b/charts/nexus3/values.yaml @@ -71,11 +71,14 @@ service: # - port: 8082 # name: docker-group # containerPort: 8082 - # host: nexus-docker.local + # hosts: + # - nexus-docker.local # - port: 8083 # name: docker-hosted # containerPort: 8083 - # host: nexus-docker-hosted.local + # hosts: + # - nexus-docker-hosted-1.local + # - nexus-docker-hosted-2.local metrics: enabled: false @@ -95,7 +98,8 @@ ingress: # - hosts: # - nexus.local # - nexus-docker.local - # - nexus-docker-hosted.local + # - nexus-docker-hosted-1.local + # - nexus-docker-hosted-2.local # secretName: nexus-local-tls persistence: