I am new on kubernetes, I created a k8s cluster which contain two worker node - Node-AZ1 and Node-AZ2.
For my objective, I would like to set two pods/deploys with same web application image for High availability setting. i.e.
K8S Cluster -> Worker Node: Node-AZ1
-> Pod: Backend-App-AZ1-{id}
-> Deploy: Backend-App-AZ1 (Backend App Image v1.0.0)
-> Worker Node: Node-AZ2
-> Pod: Backend-App-AZ2-{id}
-> Deploy: Backend-App-AZ2 (Backend App Image v1.0.0)
In k8s service setting, it contain the type - LoadBalancer, but seem that it is not proxy type load balancer. In my question, I would like to find a tool/config setting that can be the proxy type load balancer for proxying the request to AZ1 and AZ2 averagely. E.G. Post Request to : http://www.sample.com/api the load balancer will proxy the request to either the api service on workload:Backend-App-AZ1 or the api service on workload:Backend-App-AZ2
CodePudding user response:
i would recommend using the Nginx ingress if you can use it and handling the traffic using it
So traffic will flow like
internet -> ingress > K8s service > Deployments > PODs
You can checkout : https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/
Or daemon set : https://github.com/nginxinc/kubernetes-ingress/blob/master/deployments/daemon-set/nginx-ingress.yaml