I installed a mini cube on my ubuntu 16.04 computer and started a cluster with the message
"Kubernetes is available at https://192.168.99.100:443"
Then I deployed the nginx service with the following command
> kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80 --expose
> kubectl.sh get pods -o wide NAME READY STATUS RESTARTS AGE NODE my-nginx-2494149703-8jnh4 1/1 Running 0 13m 127.0.0.1 my-nginx-2494149703-q09be 1/1 Running 0 13m 127.0.0.1 > kubectl.sh get services -o wide NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR kubernetes 10.0.0.1 <none> 443/TCP 14m <none> my-nginx 10.0.0.83 <none> 80/TCP 13m run=my-nginx > kubectl.sh get nodes -o wide NAME STATUS AGE 127.0.0.1 Ready 16m
Questions:
1) Is node 127.0.0.1 my local development machine? This confused me the most.
2) I correctly understand the following: the cluster (nodes, API server of the kubernetes) has internal IP addresses at 10.0.0.x, and their corresponding external IP addresses are 192.168.99.x. Then 2 containers will have IP addresses in the range of 10.0.1.x and 10.0.2.x?
3) Why does the external IP for services not exist? Even for the Kubernett service. Isn't it a 192.168.99.43 external IP?
4) Most importantly, how do I connect to the nginx service from my laptop?
source share