Alexander Kondaurov
Alexander Kondaurov

Reputation: 4123

Run nexus in kubernetes cluster using helm

There is a helm chart for nexus: https://github.com/helm/charts/tree/master/stable/sonatype-nexus

I installed it like using helm:

helm install stable/sonatype-nexus --name=nexus

But it didn't work because of nexus-proxy. There is logs for nexus-proxy container:

[vert.x-eventloop-thread-0] [io.vertx.ext.web.impl.RoutingContextImplBase] Unexpected exception in route

So, i started to google and found that post: https://github.com/travelaudience/nexus-proxy/issues/4

There we no answer except this:

I encountered this error. Using imageTag=2.2.0 fixed the problem for me.

So i deleted nexus release and installed that chart like so:

helm install stable/sonatype-nexus --name=nexus -f nexus.yml

nexus.yml is this file with replaced value of nexus-proxy image tag https://github.com/helm/charts/blob/master/stable/sonatype-nexus/values.yaml

Now, when i hit http://localhost:8080/ i get this:

Invalid host. To browse Nexus, click here/. To use the Docker registry, point your client at .

Tadaaam, what i did wrong? I try to install this chart in my kubernetes on mac. I haven't succeed in installing this chart on GKE

Upvotes: 8

Views: 7668

Answers (4)

For testing purposes following configuration can be used on GKE via port forwarding.

In order to use on production (with ingress), you should use real host names.

ingress:
  enabled: false
  ...

nexusProxy:
  ...
  env:
    nexusDockerHost: 127.0.0.1
    nexusHttpHost: 127.0.0.1
  ...

Upvotes: 0

Noman Sadiq
Noman Sadiq

Reputation: 46

I have fixed this with following change, this seems to be port issue, I have deployed on AWS EKS private

nexusProxy:
  enabled: true
  # svcName: proxy-svc
  imageName: quay.io/travelaudience/docker-nexus-proxy
  imageTag: 2.6.0
  imagePullPolicy: IfNotPresent
  port: 8080
  targetPort: 8080

change

nexusProxy:
  enabled: true
  # svcName: proxy-svc
  imageName: quay.io/travelaudience/docker-nexus-proxy
  imageTag: 2.6.0
  imagePullPolicy: IfNotPresent
  port: 8080
  targetPort: 8081

Only change the port from 8080 to 8081

Upvotes: 0

Xavi
Xavi

Reputation: 23

Worked for me! It created another ReplicaSet and I had to delete the original one in order to avoid a healthcheck failure in the new pod, but then it worked properly.

Upvotes: 1

Hawk Ista
Hawk Ista

Reputation: 81

I have met the same issue with you (in stable/sonatype-nexus-1.10.0) and I have tried to solve that. I guess your problem is due to docker images like quay.io/travelaudience/docker-nexus-proxy. You can see configuration in values.yaml like

nexusProxy:
  imageName: quay.io/travelaudience/docker-nexus-proxy
  imageTag: 2.3.0
  imagePullPolicy: IfNotPresent
  port: 8080
  env:
    nexusDockerHost: 127.0.0.1
    nexusHttpHost: 127.0.0.1
    enforceHttps: false
    cloudIamAuthEnabled: false

By default, nexusDockerHost and nexusHttpHost is left blank, so the proxy will deny your access to nexus. to allow access nexus via docker-nexus-proxy. In my case, after I have added 127.0.0.1 to nexusDockerHost/nexusHttpHost, I could access nexus ui from the chart's nodeport configuration.

Upvotes: 8

Related Questions