[英]Unable to access the nginx through Kubernetes LoadBalancer service
[英]LoadBalancer - Kubernetes or Nginx Or Both
Nginx 默認支持“循環”負載平衡,如果我將 kubernetes 服務類型設置為“LoadBalancer”(我認為這是服務提供商的網絡負載均衡器?像這樣)不會在堆棧中創建兩個負載平衡器(理論上)?
假設,我在 nginx (網絡服務器)后面有一個網絡應用程序,所以我想在這種情況下不會發生 nginx-LB。 但是當它擴展到 nginx 后面的多個 web 應用程序時,它將開始負載平衡。
最好的拓撲是什么,讓所有 Web 應用程序利用網絡負載平衡器(硬件)或單個 nginx 后面的多個 Web 應用程序?
1) 單個 nginx 用於多個網絡應用程序
|=> web-app
network-LB <==> nginx-LB <==> web-app
|=> web-app
2)讓網絡LB為每個Web應用程序作為Web服務器進行平衡和nginx?
nginx-LB <==> web-app
network-LB <==> nginx-LB <==> web-app
nginx-LB <==> web-app
So the general flow for this would be to incorporate an Nginx ingress instead of Nginx as a LB, as the Nginx ingress controller is optimized for this kind of routing and supports autoscaling so you don't need to handle anything underload, the idea being.
|=> web-app
network-LB <==> nginx-controller (one or more) <==> web-app
|=> web-app
但是,您的 nginx 控制器在監視您的 Web 應用程序的端點並在更改時更新配置,因此具有較少的躍點(比需要事先進行 IP 查找的正常路由更優化)。 您可以在此處閱讀有關 nginx 入口的更多信息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.