From def6abdfd80803d27c41980463f65a7dfa3d9094 Mon Sep 17 00:00:00 2001 From: F43RY Date: Tue, 15 Feb 2022 19:00:36 +0100 Subject: [PATCH 1/4] used $index for naming Changed naming for ingress and backend service to fix issue https://github.com/sonatype/helm3-charts/issues/158 --- charts/nexus-repository-manager/templates/ingress.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/nexus-repository-manager/templates/ingress.yaml b/charts/nexus-repository-manager/templates/ingress.yaml index 6decf527..02272d0b 100644 --- a/charts/nexus-repository-manager/templates/ingress.yaml +++ b/charts/nexus-repository-manager/templates/ingress.yaml @@ -44,12 +44,12 @@ spec: number: 8081 {{ if .Values.nexus.docker.enabled }} -{{ range $registry := .Values.nexus.docker.registries }} +{{ range $index, $registry := .Values.nexus.docker.registries }} --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ $fullName | trunc 49 }}-docker-{{ $registry.port }} + name: {{ $fullName | trunc 46 }}-{{ $index }}-docker-{{ $registry.port }} labels: {{- include "nexus.labels" $ | nindent 4 }} {{- if $.Values.nexus.extraLabels }} @@ -74,7 +74,7 @@ spec: pathType: Prefix backend: service: - name: {{ $fullName | trunc 49 }}-docker-{{ $registry.port }} + name: {{ $fullName | trunc 46 }}-{{ $index }}-docker-{{ $registry.port }} port: number: {{ $registry.port }} {{- end }} {{- /* range of nexus.docker.registries */ -}} From 184f2c826da4ea4e57bec50f90c082a9fd396114 Mon Sep 17 00:00:00 2001 From: F43RY Date: Tue, 15 Feb 2022 19:02:16 +0100 Subject: [PATCH 2/4] used $index for service name introduced commit to fix https://github.com/sonatype/helm3-charts/issues/158 --- charts/nexus-repository-manager/templates/service.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/nexus-repository-manager/templates/service.yaml b/charts/nexus-repository-manager/templates/service.yaml index ba7acb7f..2b3b13e6 100644 --- a/charts/nexus-repository-manager/templates/service.yaml +++ b/charts/nexus-repository-manager/templates/service.yaml @@ -30,12 +30,12 @@ spec: {{- end }} {{- if .Values.nexus.docker.enabled }} -{{- range $registry := .Values.nexus.docker.registries }} +{{- range $index, $registry := .Values.nexus.docker.registries }} --- apiVersion: v1 kind: Service metadata: - name: {{ include "nexus.fullname" $ | trunc 49 }}-docker-{{ $registry.port }} + name: {{ include "nexus.fullname" $ | trunc 46 }}-{{ $index }}-docker-{{ $registry.port }} {{- if $.Values.service.annotations }} annotations: {{ toYaml $.Values.service.annotations | indent 4 }} From ea99cfbc0631a837845f80959ddfbc4268d8b5d6 Mon Sep 17 00:00:00 2001 From: F43RY Date: Tue, 15 Feb 2022 19:09:06 +0100 Subject: [PATCH 3/4] used $index and $registry for container name Used registries id for naming containers to fix https://github.com/sonatype/helm3-charts/issues/158 --- charts/nexus-repository-manager/templates/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/nexus-repository-manager/templates/deployment.yaml b/charts/nexus-repository-manager/templates/deployment.yaml index a1f18805..e7997740 100644 --- a/charts/nexus-repository-manager/templates/deployment.yaml +++ b/charts/nexus-repository-manager/templates/deployment.yaml @@ -76,9 +76,9 @@ spec: - name: nexus-ui containerPort: {{ .Values.nexus.nexusPort }} {{- if .Values.nexus.docker.enabled }} - {{- range .Values.nexus.docker.registries }} - - name: docker-{{ .port }} - containerPort: {{ .port }} + {{- range $index, $registry := .Values.nexus.docker.registries }} + - name: docker-{{ $index }}-{{ $registry.port }} + containerPort: {{ $registry.port }} {{- end }} {{- end }} livenessProbe: From 88eb94510de046298bc5a0865ea365b458545b67 Mon Sep 17 00:00:00 2001 From: Fabry Date: Thu, 17 Feb 2022 13:11:24 +0100 Subject: [PATCH 4/4] Enable tls of registry based on secretName existance --- charts/nexus-repository-manager/templates/ingress.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/nexus-repository-manager/templates/ingress.yaml b/charts/nexus-repository-manager/templates/ingress.yaml index 02272d0b..f7374f16 100644 --- a/charts/nexus-repository-manager/templates/ingress.yaml +++ b/charts/nexus-repository-manager/templates/ingress.yaml @@ -62,10 +62,12 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if hasKey $registry "secretName" }} tls: - hosts: - {{ $registry.host | quote }} secretName: {{ $registry.secretName }} + {{- end }} rules: - host: {{ $registry.host }} http: