Hello everyone,
I have a doubt and here is my use-case.
I have 4 vagrant machines
K8-master: 192.168.1.11
K8-minion1: 192.168.1.12
K8-minion2: 192.168.1.13
Nginx: 192.168.1.14
My k8s cluster is up and running.
Matser instance has below services:
* etcd
* k8-apiserver
* k8-controller-manager
* k8-scheduler
* flannel
Minion instances are running below services:
* kube-proxy
* kubelet
* docker
* flannel
Nginx instance is running below services:
* nginx
* flannel
* kube-proxy
I am able to deploy my simple app (which is serving a simple index.html page) using busybox docker image with CMD as: httpd -f -p 80
When I try to use NodePort to serve my app to outside world which means my app pods are running on minion1 and minion2 and K8 attach the respective service to any port to the host OS (assume: 30XXX)and when I hit the minion1-IP:<30XXX> or minion2-IP:<30XXX> I am getting the index.html.
So far everything is fine. I can use Nginx as web server and define minions-IP as an upstream. But what if for some reason my one minion goes down some traffic will not be able to see my app. Did I speculate it correctly? Please validate.
Now, here comes Nginx role as an Ingress in K8 cluster. That's why I configured flannel and kube-proxy on Nginx so that it can route traffic to the pods.
In nginx conf file I just give the app k8 service IP and port in the upstream.
But when I try to achieve this it is not working and throwing 500 Gateway error. But when I reproduce the same use-case on AWS it is working fine.
I think there might be some issue with vagrant networking related.
And, why do my all vagrant machines get eth0 as 10.0.2.15 in every vagrant machine? It gets precendence over my assigned IP (public/private).
I am unable to understand this logic. Can someone help me or illuminate me over this issue?
Thanks in advance!