No ingress address on minikube Kubernetes cluster with nginx ingress controller

南笙酒味 提交于 2019-12-13 02:19:42

问题


I've got the following:

ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: abcxyz
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - host: abcxyz
    http:
      paths:
      - path: /a/
        backend:
          serviceName: service-a
          servicePort: 80
      - path: /b/
        backend:
          serviceName: service-b
          servicePort: 80

Output of kubectl describe ingress abcxyz:

Name:             abcxyz
Namespace:        default
Address:          
Default backend:  default-http-backend:80 (<none>)
Rules:
  Host    Path  Backends
  ----    ----  --------
  abcxyz  
          /a/   service-a:80 (<none>)
          /b/   service-b:80 (<none>)
Annotations:
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  CREATE  16m                nginx-ingress-controller  Ingress default/abcxyz
  Normal  UPDATE  12m (x2 over 15m)  nginx-ingress-controller  Ingress default/abcxyz

Why is the address empty? I've installed the 'nginx ingress controller' through helm using helm install stable/nginx-ingress - and all of it's pods relevent seem to be running fine.

How can I provide access to the ingress?


回答1:


Type

minikube ip

to retrieve the master IP. for example:

bash-3.2$ minikube ip
192.168.1.100

The command that provides information about the kubernetes cluster is:

bash-3.2$ kubectl cluster-info
Kubernetes master is running at https://192.168.1.100:8443
KubeDNS is running at https://192.168.1.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

You can test the ingress controller from the host machine using curl:

bash-3.2$ curl http://192.168.1.100:80
default backend - 404

Finally, add a host entry to be able to use a name to refer to the cluster IP address

In /etc/hosts add:

192.168.1.100   abcxyz


来源:https://stackoverflow.com/questions/51243717/no-ingress-address-on-minikube-kubernetes-cluster-with-nginx-ingress-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!