Skip to content

Commit

Permalink
feat(nexus3): added service.additionalPorts.hosts for multi-hosts sup…
Browse files Browse the repository at this point in the history
…port (#982)

feat(nexus3): added .service.additionalPorts.hosts for multi-hosts support

Signed-off-by: djerfy <[email protected]>
  • Loading branch information
djerfy authored Jul 8, 2024
1 parent efb6d39 commit 31a1e3b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
8 changes: 8 additions & 0 deletions charts/nexus3/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions charts/nexus3/ci/ci-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions charts/nexus3/ci/kubeconform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions charts/nexus3/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: /
Expand All @@ -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 }}
Expand Down
10 changes: 7 additions & 3 deletions charts/nexus3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 31a1e3b

Please sign in to comment.