【问题标题】:Kubernetes Helm Artifactory port inaccessibleKubernetes Helm Artifactory 端口无法访问
【发布时间】:2021-07-07 15:35:42
【问题描述】:

我正在尝试使用 Minikube & Helm 3 安装 Artifactory

我在这里和那里找到了一些其他位的说明: https://artifacthub.io/packages/helm/jfrog/artifactory-oss

我想我可能遗漏了一些关于暴露端口的明显内容。

据我所知,您需要启用“入口”吗?

所以:

minikube addons enable ingress

运行安装后,

$ cat namespace-artifactory.json
{
  "apiVersion": "v1",
  "kind": "Namespace",
  "metadata": {
    "name": "artifactory-oss",
    "labels": {
      "name": "artifactory-oss"
    }
  }
}

$ kubectl create -f namespace-artifactory.json

$ helm upgrade --install artifactory-oss --set artifactory.postgresql.postgresqlPassword=postgres_password --namespace artifactory-oss jfrog/artifactory-oss
Release "artifactory-oss" does not exist. Installing it now.
NAME: artifactory-oss
LAST DEPLOYED: Mon Apr 12 16:20:53 2021
NAMESPACE: artifactory-oss
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Congratulations. You have just deployed JFrog Artifactory OSS!


$ kubectl get namespace
NAME                   STATUS   AGE
artifactory-oss        Active   99s
default                Active   6d
kube-node-lease        Active   6d
kube-public            Active   6d
kube-system            Active   6d
kubernetes-dashboard   Active   4d22h


$ kubectl get svc --namespace artifactory-oss
NAME                                  TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
artifactory-oss-artifactory           ClusterIP      10.98.138.1      <none>        8082/TCP,8081/TCP            100s
artifactory-oss-artifactory-nginx     LoadBalancer   10.104.240.114   <pending>     80:32112/TCP,443:30681/TCP   100s
artifactory-oss-postgresql            ClusterIP      10.100.119.202   <none>        5432/TCP                     100s
artifactory-oss-postgresql-headless   ClusterIP      None             <none>        5432/TCP                     100s


$ kubectl --namespace artifactory-oss get pods
NAME                                                 READY   STATUS    RESTARTS   AGE
artifactory-oss-artifactory-0                        1/1     Running   0          2m23s
artifactory-oss-artifactory-nginx-75b745c955-ffgql   1/1     Running   0          2m23s
artifactory-oss-postgresql-0                         1/1     Running   0          2m23s


$ kubectl logs --namespace artifactory-oss artifactory-oss-artifactory-0
... Server configuration reloaded on localhost:8046
... Server configuration reloaded on localhost:8049
... Server configuration reloaded on :8082
... frontend (jffe) service initialization completed in 40.24 seconds. Listening on port: port 8070

所以现在看起来它可以工作了,也许,除了我无法访问任何端口。

  • 集群 IP 不同。看起来很奇怪。
  • 没有外部 IP。看起来很奇怪。

我使用 firewalld 打开了 8000-9000 范围内的端口:

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources:
  services: dhcpv6-client ssh
  ports: 8000-9000/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

但是 80** 个端口都没有达到任何目标。

任何熟悉此安装或知道我做错了什么的人?

谢谢

------------编辑1:

kubectl --namespace artifactory-oss describe service artifactory-oss-artifactory-nginx

Name:                     artifactory-oss-artifactory-nginx
Namespace:                artifactory-oss
Labels:                   app=artifactory
                          app.kubernetes.io/managed-by=Helm
                          chart=artifactory-11.13.0
                          component=nginx
                          heritage=Helm
                          release=artifactory-oss
Annotations:              meta.helm.sh/release-name: artifactory-oss
                          meta.helm.sh/release-namespace: artifactory-oss
Selector:                 app=artifactory,component=nginx,release=artifactory-oss
Type:                     LoadBalancer
IP Families:              <none>
IP:                       10.104.240.114
IPs:                      10.104.240.114
Port:                     http  80/TCP
TargetPort:               80/TCP
NodePort:                 http  32112/TCP
Endpoints:                172.17.0.2:80
Port:                     https  443/TCP
TargetPort:               443/TCP
NodePort:                 https  30681/TCP
Endpoints:                172.17.0.2:443
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

--------编辑2:

 minikube tunnel

Status:
        machine: minikube
        pid: 1380280
        route: 10.96.0.0/12 -> 192.168.49.2
        minikube: Running
        services: [artifactory-oss-artifactory-nginx]
    errors:
                minikube: no errors
                router: no errors
                loadbalancer emulator: no errors

【问题讨论】:

  • 能否也发布 artifactory-oss-artifactory-nginx Pod 的日志?
  • nginx 没有日志:/
  • @djb 下面的解决方案有帮助吗?
  • 还没有,我还不知道问题出在哪里。一切似乎都好了。我认为问题可能在于 K8s 正在为集群创建一个新 IP,但我在一台机器上,我需要它来使用主机 IP,因为新的随机 IP 可能不会在 DNS 上列入白名单。不过只是猜测。

标签: kubernetes kubernetes-helm artifactory minikube


【解决方案1】:

看看为什么你的 nginx 入口是&lt;pending&gt;

kubectl --namespace artifactory-oss describe service artifactory-oss-artifactory-nginx

我们在生产中使用它,它需要安装一个 nginx 入口引擎。 minikube 中可能需要的不仅仅是 ingress 插件

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-01-01
  • 2021-09-30
  • 2020-09-14
  • 2022-07-06
  • 2019-06-19
  • 2022-01-15
  • 1970-01-01
相关资源
最近更新 更多