Why is there no external IP using Contour on Minikube?

12/17/2019

I installed contour locally on minikube version: v1.5.0 with:

kubectl apply -f https://projectcontour.io/quickstart/contour.yaml

I check the details of the contour ingress controller with:

$ kubectl get -n projectcontour service contour -o wide
NAME      TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE     SELECTOR
contour   ClusterIP   10.103.81.4   <none>        8001/TCP   4d12h   app=contour

Now in the book it says:

If you are using minikube, you probably won’t have anything listed for EXTERNAL-IP. To fix this, you need to open a separate terminal window and run minikube tunnel. This configures networking routes such that you have unique IP addresses assigned to every service of type: LoadBalancer. - Brendan Burns. “Kubernetes: Up and Running.”

I ran minikube tunnel in a seperate window but it still did not give me an EXTERNAL-IP.

How can I get this EXTERNAL-IP so I can point some hosts to it and test the ingress.

Update

I get all the services in the namespace and the enoy service has an external ip. I added those to /etc/hosts and it worked.

$ kubectl get -n projectcontour service -o wide
NAME      TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                      AGE     SELECTOR
contour   ClusterIP      10.103.81.4     <none>          8001/TCP                     4d12h   app=contour
envoy     LoadBalancer   10.97.220.191   10.97.220.191   80:32162/TCP,443:31422/TCP   4d12h   app=envoy

Update 2:

Only where the service.type = LoadBalancer do you get an externalIP:

$ kubectl describe service envoy -n projectcontour
Name:                     envoy
Namespace:                projectcontour
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"service.beta.kubernetes.io/aws-load-balancer-backend-protocol":"tcp"},"nam...
                          service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
Selector:                 app=envoy
Type:                     LoadBalancer
IP:                       10.97.220.191
LoadBalancer Ingress:     10.97.220.191
Port:                     http  80/TCP
TargetPort:               80/TCP
NodePort:                 http  32162/TCP
Endpoints:                172.17.0.17:80
Port:                     https  443/TCP
TargetPort:               443/TCP
NodePort:                 https  31422/TCP
Endpoints:                172.17.0.17:443
Session Affinity:         None
External Traffic Policy:  Local
HealthCheck NodePort:     31511
Events:                   <none>

and:

$ kubectl describe service contour -n projectcontour
Name:              contour
Namespace:         projectcontour
Labels:            <none>
Annotations:       kubectl.kubernetes.io/last-applied-configuration:
                     {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"contour","namespace":"projectcontour"},"spec":{"ports":[{"name":"...
Selector:          app=contour
Type:              ClusterIP
IP:                10.103.81.4
Port:              xds  8001/TCP
TargetPort:        8001/TCP
Endpoints:         172.17.0.13:8001,172.17.0.14:8001
Session Affinity:  None
Events:            <none>
-- surfer190
kubernetes
kubernetes-ingress

2 Answers

12/17/2019

Try updating the service to loadbalancer

or just try and patch external IP

$ kubectl patch svc svc_name -p '{"spec":{"externalIPs":["your_external_ip"]}}'
-- Leo Praveen Chelliah
Source: StackOverflow

12/17/2019

Your service type would need to be LoadBalancer to have an external-ip.

-- Fei
Source: StackOverflow