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: diff --git a/charts/nexus-repository-manager/templates/ingress.yaml b/charts/nexus-repository-manager/templates/ingress.yaml index 6decf527..f7374f16 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 }} @@ -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: @@ -74,7 +76,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 */ -}} 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 }}