使用Helm在Kubernetes集群中运行Nexus

Ale*_*rov 5 nexus google-kubernetes-engine kubernetes-helm

有一个关系图的舵图:https : //github.com/helm/charts/tree/master/stable/sonatype-nexus

我像使用头盔一样安装了它:

helm install stable/sonatype-nexus --name=nexus
Run Code Online (Sandbox Code Playgroud)

但是由于代理关系而无法正常工作。nexus-proxy容器有日志:

[vert.x-eventloop-thread-0] [io.vertx.ext.web.impl.RoutingContextImplBase]路由中意外的异常

因此,我开始使用Google并发现了该帖子:https : //github.com/travelaudience/nexus-proxy/issues/4

除此以外,我们没有其他答案:

我遇到了这个错误。使用imageTag = 2.2.0为我解决了这个问题。

所以我删除了nexus版本并按如下方式安装了该图表:

helm install stable/sonatype-nexus --name=nexus -f nexus.yml
Run Code Online (Sandbox Code Playgroud)

nexus.yml是此文件,替换了nexus-proxy图像标签的值 https://github.com/helm/charts/blob/master/stable/sonatype-nexus/values.yaml

现在,当我点击http:// localhost:8080 /时,我得到了:

无效的主机。要浏览Nexus,请点击此处/。要使用Docker注册表,请将您的客户端指向。

Tadaaam,我做错了什么?我尝试在Mac的kubernetes中安装此图表。我尚未在GKE上成功安装此图表

小智 8

我遇到了同样的问题(在 stable/sonatype-nexus-1.10.0 中),我试图解决这个问题。我猜你的问题是由于像 quay.io/travelaudience/docker-nexus-proxy 这样的 docker 图像。您可以在 values.yaml 中看到配置,例如

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
Run Code Online (Sandbox Code Playgroud)

默认情况下,nexusDockerHost 和 nexusHttpHost 为空,因此代理将拒绝您访问 nexus。允许通过 docker-nexus-proxy 访问 nexus。就我而言,在将 127.0.0.1 添加到 nexusDockerHost/nexusHttpHost 后,我​​可以从图表的 nodeport 配置访问 nexus ui。