diff --git a/charts/nexus-repository-manager/README.md b/charts/nexus-repository-manager/README.md index 69fb21cf..0ebab714 100644 --- a/charts/nexus-repository-manager/README.md +++ b/charts/nexus-repository-manager/README.md @@ -123,6 +123,7 @@ The following table lists the configurable parameters of the Nexus chart and the | `nexus.docker.enabled` | Enable/disable Docker support | `false` | | `nexus.docker.registries` | Support multiple Docker registries | (see below) | | `nexus.docker.registries[0].host` | Host for the Docker registry | `cluster.local` | +| `nexus.docker.registries[0].hostMulti` | Array of the hosts for the Docker registry in case of multiple FQDN | `[]`| | `nexus.docker.registries[0].port` | Port for the Docker registry | `5000` | | `nexus.docker.registries[0].secretName` | TLS Secret Name for the ingress | `registrySecret` | | `nexus.env` | Nexus Repository environment variables | `[{INSTALL4J_ADD_VM_PARAMS: -Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap}]` | @@ -141,13 +142,14 @@ The following table lists the configurable parameters of the Nexus chart and the | `nexus.readinessProbe.failureThreshold` | Number of attempts before failure | 6 | | `nexus.readinessProbe.timeoutSeconds` | Time in seconds after readiness probe times out | `nil` | | `nexus.readinessProbe.path` | Path for ReadinessProbe | / | -| `nexus.hostAliases` | Aliases for IPs in /etc/hosts | [] | +| `nexus.hostAliases` | Aliases for IPs in /etc/hosts | [] | | `nexus.properties.override` | Set to true to override default nexus.properties | `false` | | `nexus.properties.data` | A map of custom nexus properties if `override` is set to true | `nexus.scripts.allowCreation: true` | | `ingress.enabled` | Create an ingress for Nexus Repository | `true` | | `ingress.annotations` | Annotations to enhance ingress configuration | `{kubernetes.io/ingress.class: nginx}` | | `ingress.tls.secretName` | Name of the secret storing TLS cert, `false` to use the Ingress' default certificate | `nexus-tls` | | `ingress.path` | Path for ingress rules. GCP users should set to `/*`. | `/` | +| `ingress.hostMulti` | Array of the hosts for the UI in case of multiple FQDN | `[]` | | `tolerations` | tolerations list | `[]` | | `config.enabled` | Enable configmap | `false` | | `config.mountPath` | Path to mount the config | `/sonatype-nexus-conf` | diff --git a/charts/nexus-repository-manager/templates/ingress.yaml b/charts/nexus-repository-manager/templates/ingress.yaml index 198fdfe6..3fcf53af 100644 --- a/charts/nexus-repository-manager/templates/ingress.yaml +++ b/charts/nexus-repository-manager/templates/ingress.yaml @@ -32,6 +32,21 @@ spec: {{- end }} {{- end }} rules: +{{- if .Values.ingress.hostMulti }} +{{- $hostPath := .Values.ingress.hostPath -}} +{{ range $repo := .Values.ingress.hostMulti }} + - host: {{ $repo }} + http: + paths: + - path: {{ $hostPath }} + pathType: Prefix + backend: + service: + name: {{ $fullName }} + port: + number: 8081 +{{- end }} {{- /* range of .Values.ingress.hostRepo */ -}} +{{ else }} - host: {{ .Values.ingress.hostRepo }} http: paths: @@ -42,7 +57,7 @@ spec: name: {{ $fullName }} port: number: 8081 - +{{- end }} {{- /* .Values.ingress.hostMulti */ -}} {{ if .Values.nexus.docker.enabled }} {{ range $registry := .Values.nexus.docker.registries }} --- @@ -70,6 +85,20 @@ spec: - {{ $registry.host | quote }} secretName: {{ $registry.secretName }} rules: +{{- if $registry.hostMulti }} +{{ range $repo := $registry.hostMulti }} + - host: {{ $repo }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $fullName | trunc 49 }}-docker-{{ $registry.port }} + port: + number: {{ $registry.port }} +{{- end }} {{- /* range of $registry.hostMulti */ -}} +{{ else }} - host: {{ $registry.host }} http: paths: @@ -80,6 +109,7 @@ spec: name: {{ $fullName | trunc 49 }}-docker-{{ $registry.port }} port: number: {{ $registry.port }} +{{- end }} {{- /* registry.hostMulti */ -}} {{- end }} {{- /* range of nexus.docker.registries */ -}} {{- end }} {{- /* nexus.docker.enabled */ -}} {{- end }} {{- /* ingress.enabled */ -}} diff --git a/charts/nexus-repository-manager/values.yaml b/charts/nexus-repository-manager/values.yaml index bffbfbc6..082aab97 100644 --- a/charts/nexus-repository-manager/values.yaml +++ b/charts/nexus-repository-manager/values.yaml @@ -14,6 +14,8 @@ nexus: enabled: false # registries: # - host: chart.local + # # Array to use multiple fqdn for the same registry. The host value should be present + # hostMulti: [] # port: 5000 # secretName: registry-secret env: @@ -111,6 +113,8 @@ ingress: nginx.ingress.kubernetes.io/proxy-body-size: "0" hostPath: / hostRepo: repo.demo + # Array to use multiple fqdn for the same registry. The hostRepo value should be present + # hostMulti: [] # tls: # - secretName: nexus-local-tls # hosts: