Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ganchandrasekaran opened this issue Mar 26, 2019 · 4 comments
Labels
co/service issues related to the service feature triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@ganchandrasekaran
Copy link

ganchandrasekaran commented Mar 26, 2019

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



Name:               kubernetes-bootcamp-6bf84cb898-7lwq4
Namespace:          default
Priority:           0
PriorityClassName:  <none>
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:        <none>
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:    <none>
    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:  <none>
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
@afbjorklund
Copy link
Collaborator

afbjorklund commented Mar 26, 2019

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.

@ganchandrasekaran
Copy link
Author

ganchandrasekaran commented Mar 29, 2019

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

@ganchandrasekaran ganchandrasekaran changed the title EXTERNAL-IP is always none when using NodePort #723 EXTERNAL-IP is always none and unable to reach to Service from Host machine #723 Mar 29, 2019
@balopat balopat added the co/service issues related to the service feature label Apr 4, 2019
@balopat
Copy link
Contributor

balopat commented Apr 4, 2019

  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 vbox/macos: "service hello-minikube" does not return #3587

@balopat balopat added the triage/duplicate Indicates an issue is a duplicate of other open issue. label Apr 4, 2019
@balopat
Copy link
Contributor

balopat commented Apr 4, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/service issues related to the service feature triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

3 participants