【问题标题】:Kubernetes can't access loadbalancer url using minikube - nopcommerceKubernetes 无法使用 minikube 访问负载均衡器 url - nopcommerce
【发布时间】:2022-01-05 02:38:47
【问题描述】:

为了获得更多托管 kubernetes 集群的经验,我创建了一个 nopcommerce 部署。对于服务,我使用负载均衡器类型。

运行命令minikube service nopcommerce --url 给我网址http://192.168.76.2:30409。我无法连接到此网址。使用 curl 打印的详细日志:

curl -L http://192.168.76.2:30409 --verbose

  • 正在尝试 192.168.76.2:30409...

  • 连接到 192.168.76.2 (192.168.76.2) 端口 30409 (#0) 获取/HTTP/1.1 主机:192.168.76.2:30409 用户代理:curl/7.79.1 接受:/

  • 接收失败:对等方重置连接

  • 关闭连接 0 curl: (56) Recv failure: Connection reset by peer

我的kustomization.yaml

secretGenerator:
- name: mysql-pass
  literals:
  - password='VerySecretPassword'
resources:
  - mysql.yaml
  - nopcommerce.yaml

还有nopcommerce.yaml

---
apiVersion: v1
kind: Service
metadata:
  name: nopcommerce
  labels:
    app: nopcommerce
spec:
  selector:
    app: nopcommerce
    tier: app
  ports:
    - port: 80
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nopcommerce
spec:
  selector:
    matchLabels:
      app: nopcommerce
      tier: app
  template:
    metadata:
      labels:
        app: nopcommerce
        tier: app
    spec:
      containers:
        - name: nopcommerce
          image: nopcommerceteam/nopcommerce:latest
          resources:
            limits:
              memory: "128Mi"
              cpu: "500m"
          ports:
            - containerPort: 80
              name: web

【问题讨论】:

    标签: kubernetes load-balancing minikube kubernetes-pod nopcommerce


    【解决方案1】:

    尝试以下方法:

    疑难解答: 尝试运行可以从您的系统连接到同一服务器的其他应用程序。

    SSL: 如果 URL 使用 HTTPS;未配置正确的 SSL 设置会导致旧版本的 curl 出错。 远程服务器可能启用了防火墙设置,因此您需要检查已安装的其他库并与服务冲突。

    升级所有软件包: “Connection reset by peer”,是由于包过时造成的,你需要删除不必要的并检查类似的。

    超时: 在握手之前建立连接的服务器站点超时。

    【讨论】:

      猜你喜欢
      • 2021-09-24
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 2019-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-23
      相关资源
      最近更新 更多