Minikube: EXTERNAL-IP is always none and unable to reach to Service from Host machine #723

Created on 26 Mar 2019  路  4Comments  路  Source: kubernetes/minikube

For instance following the tutorial on: https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/

When I run
kubectl get services
Output:

NAME                  TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
kubernetes            ClusterIP   10.96.0.1        <none>        443/TCP          15m
kubernetes-bootcamp   NodePort    10.108.199.215   <none>        8080:31348/TCP   10m

Note: I ran the minikube behind the Poxy and using Cert by following: https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md

```kubectl describe pods

Name: kubernetes-bootcamp-6bf84cb898-7lwq4
Namespace: default
Priority: 0
PriorityClassName:
Node: minikube/10.0.2.15
Start Time: Tue, 26 Mar 2019 10:31:21 +0900
Labels: pod-template-hash=6bf84cb898
run=kubernetes-bootcamp
Annotations:
Status: Running
IP: 172.17.0.4
Controlled By: ReplicaSet/kubernetes-bootcamp-6bf84cb898
Containers:
kubernetes-bootcamp:
Container ID: docker://a2cb13a0bdc422dbb22df33f7d74469f8f6a9187f2d34bfd6076b74b0eac02f4
Image: gcr.io/google-samples/kubernetes-bootcamp:v1
Image ID: docker-pullable://gcr.io/google-samples/kubernetes-bootcamp@sha256:0d6b8ee63bb57c5f5b6156f446b3bc3b3c143d233037f3a2f00e279c8fcc64af
Port: 8080/TCP
Host Port: 0/TCP
State: Running
Started: Tue, 26 Mar 2019 10:31:31 +0900
Ready: True
Restart Count: 0
Environment:
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-2z54m (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
default-token-2z54m:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-2z54m
Optional: false
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 9m55s default-scheduler Successfully assigned default/kubernetes-bootcamp-6bf84cb898-7lwq4 to minikube
Normal Pulling 9m55s kubelet, minikube pulling image "gcr.io/google-samples/kubernetes-bootcamp:v1"
Normal Pulled 9m46s kubelet, minikube Successfully pulled image "gcr.io/google-samples/kubernetes-bootcamp:v1"
Normal Created 9m45s kubelet, minikube Created container
Normal Started 9m45s kubelet, minikube Started container

But the Curl to the Service doesnt work:

HOST:~$ curl (minikube service hello-minikube --url)
curl: (52) Empty reply from server
```

cservice triagduplicate

Most helpful comment

  1. External IP is always going to be None, unless you deploy the Service as type: LoadBalancer. If you do that, you have to run minikube tunnel to get access to the service.
  2. The port should work - I believe this is a dupe of #3587

All 4 comments

I think this is normal, you need a LoadBalancer to get an external IP ?

However, you should be able to reach it on minikube ip and the port.

Please note, when I login to the minikube I am able to curl to the service:

HOST:~$ minikube service hello-minikube --url
http://192.168.99.100:31652
HOST:~$ minikube ssh
                         _             _
            _         _ ( )           ( )
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$ curl 127.0.0.1:31652
CLIENT VALUES:
client_address=172.17.0.1
command=GET
real path=/
query=nil
request_version=1.1
request_uri=http://127.0.0.1:8080/

SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001

HEADERS RECEIVED:
accept=*/*
host=127.0.0.1:31652
user-agent=curl/7.60.0
BODY:
-no body in request-

I am also able to ping to the Machine from the host:

HOST:~$ ping 192.168.99.100
PING 192.168.99.100 (192.168.99.100) 56(84) bytes of data.
64 bytes from 192.168.99.100: icmp_seq=1 ttl=64 time=0.490 ms
64 bytes from 192.168.99.100: icmp_seq=2 ttl=64 time=1.01 ms
64 bytes from 192.168.99.100: icmp_seq=3 ttl=64 time=0.753 ms
^C

But the Curl to the Service doesnt work:

HOST:~$ curl 192.168.99.100:31652
curl: (52) Empty reply from server

The Port forwarding on the VirtualBox is not configured properly? I believe this is a bug on the Minikube

  1. External IP is always going to be None, unless you deploy the Service as type: LoadBalancer. If you do that, you have to run minikube tunnel to get access to the service.
  2. The port should work - I believe this is a dupe of #3587

Closing as a duplicate of #3587, thank you for the extra information!

Was this page helpful?
0 / 5 - 0 ratings