Accessing Website running in Kubernetes Which is Running on Virtualbox from Host OS

1/17/2017

I am going through the Kubernetes quick start on Ubuntu 16.04 running in a VirtualBox VM on a Windows 10 host.

It has a NAT network adapter with a static IP address of 192.168.133.75. I can ping this address from my host machine.

I have the "sock-shop" running my VM. This is what I get when I run kubectl describe svc front-end -n sock-shop:

Name:               front-end
Namespace:          sock-shop
Labels:             name=front-end
Selector:           name=front-end
Type:               NodePort
IP:                 10.104.66.95
Port:               <unset> 80/TCP
NodePort:           <unset> 30001/TCP
Endpoints:          10.32.0.18:8079
Session Affinity:   None

So when I go to 10.104.66.95 on my VM, I see the website and all is good, not so much on my host.

I have setup port forwarding on the network adapter as follows (I know IP addresses are options, I've also tried without them, but it didn't work):

Port Forwarding

What am I doing wrong?

-- Zeus82
docker
kubernetes
ubuntu
virtualbox

1 Answer

1/26/2017

Try accessing the NodePort on your host, access the site via: 192.168.133.75:30001

Ref: https://kubernetes.io/docs/user-guide/services/#type-nodeport

-- Steve Sloka
Source: StackOverflow