sonatype / nxrm3-helm-repository

Helm3 charts for Nexus Repository Manager
Other
33 stars 37 forks source link

Subdomains: Need a way to specify additional hosts in Ingress #43

Open jimsnab opened 1 year ago

jimsnab commented 1 year ago

For the recently added subdomain feature of Sonatype's docker repos, it is likely necessary to add additional hosts entries to ingress that correspond to the subdomains.

For example -

  1. Create a Kubernetes cluster with Sonatype in it.
  2. Go to Sonatype config and create a docker proxy registry. Give it a subdomain name of docker-proxy.
  3. Add DNS records using the method provided by your hosting provider. (For example, use external-dns and list docker-proxy.your.domain.com in the list of hostnames.)
  4. Try to use this docker-proxy URL. You might get 404 no service mapping, because while your.domain.com maps to the sonatype-nexus-repository-manager service, the subdomain docker-proxy.your.domain.com does not map to it. In my case on GCP, this will result in the subdomain getting routed to the default no service mapping backend.

There is a nexus.docker.registries that would work in this case, except, it is tied up with other logic associated with connector ports. In particular, trying to add the same sonatype-nexus-repository-manager to multiple hostnames this way will error with this service name -- notice the insertion of docker:

no Service with the name "sonatype-nexus-repository-manager-docker-8081" found

It seems the Helm chart ingress template needs to be modified to support the scenario.

jimsnab commented 1 year ago

I added the capability in https://github.com/jimsnab/nxrm3-helm-repository only to find unstable support in GCP for the load balancer with a host per subdomain. It only works if I create the LB without subdomain hosts, let it come online, and then add the subdomains as additional hosts. Two pass install is not how Helm works. And I think this is a loophole in GCP and they're trying to block the use case but forgot about the ingress update possibility. So I am giving up on the subdomains feature.

However, someone might use nginx or another cloud provider that doesn't have GCP's unstable behavior. And if so maybe adopt some form of the solution sitting in my fork ^.