2

I'm newer with kubernetes. I've installed minikube v1.5.2 in a virtualbox VM (ubuntu 19.10). I want to create a web server that I can access from the host and guest. However, I can't access it or expose an IP. Could you help me?

I've already enabled the ingress addons.

When I try list the ingress object there is no external IP and I recive this error message from ingress controller deployment:

2019/11/10 15:41:04 controller-haproxy.go:147 service does not exists
2019/11/10 15:41:09 controller.go:333: service  does not exists
2019/11/10 15:41:09 controller-haproxy.go:147 service  does not exists
2019/11/10 15:41:14 controller.go:333: service  does not exists
2019/11/10 15:41:14 controller-haproxy.go:147 service  does not exists

This is my code: https://pastebin.com/ysMPtyuV

4

1 回答 1

0

Minikube 引入了对LoadBalancervia minikube 隧道的支持。

当您不使用时,$ sudo minikube tunnel您的 LB 服务将一直处于pending状态。

您需要打开另一个 SSH 窗口并运行$ sudo minikube tunnel. 您将在一个 SSH 中收到输出,例如:

$ sudo minikube tunnel
Status:
        machine: minikube
        pid: 11549
        route: 10.96.0.0/12 -> 10.132.15.208
        minikube: Running
        services: [haproxy-ingress]
    errors: 
                minikube: no errors
                router: no errors
                loadbalancer emulator: no errors

在第二个 SSH 中,您将能够检查 LB 服务是否获取 IP 地址。

minikube:~$ kubectl get svc -w
NAME              TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
app               ClusterIP      10.105.136.11   <none>        80/TCP         68s
haproxy-ingress   LoadBalancer   10.111.24.111   <pending>     80:31187/TCP   68s
kubernetes        ClusterIP      10.96.0.1       <none>        443/TCP        11d
haproxy-ingress   LoadBalancer   10.111.24.111   10.111.24.111   80:31187/TCP   80s

请记住,minikube tunnel会话必须始终打开,否则您的 LB 将停止获取 IP 地址。

您可以使用 minikube LB 检查 Kong 的类似情况。

让我知道这是否对您有帮助。

于 2019-11-12T07:36:50.743 回答