[英]Kubernetes Load balancer without Label Selector
Trying to create a Laod Balancer resource with Kubernetes (for an EKS cluster). 尝试使用Kubernetes(用于EKS群集)创建Laod Balancer资源。 It works normally with the Label Selector, but we want to only have one LB per cluster, then let ingress direct services.
它与标签选择器一起正常工作,但我们希望每个集群只有一个LB,然后让入口直接服务。 Here is what I currently have :
这是我目前拥有的:
kind: Service
apiVersion: v1
metadata:
namespace: default
name: name
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
spec:
ports:
- port: 80
type: LoadBalancer
This creates a LB and gives it an internal DNS, but instances never get healthy (although they are). 这会创建一个LB并为其提供内部DNS,但实例永远不会健康(尽管它们是)。
Any advices 任何建议
What does the monitoring page for the LB target group show for the failures? LB目标组的监控页面显示了哪些故障? Are there HTTP error responses or just connection errors?
是否有HTTP错误响应或只是连接错误? Is the security group for the K8S nodes set up to allow ingress from the LB?
K8S节点的安全组是否设置为允许从LB进入?
Per discussion in another question you posted. 在您发布的另一个问题中进行讨论。 I think what you want is to achieve
One Load Balancer Per Cluster
, referring to this: Save on your AWS bill with Kubernetes Ingress . 我想你想要的是实现
One Load Balancer Per Cluster
,参考: 使用Kubernetes Ingress保存您的AWS账单 。
To achieve this, you would need to create: 要实现这一点,您需要创建:
Load Balancer Service
with Nginx-Ingress-Controller
pod as backend. Nginx-Ingress-Controller
pod作为后端的Load Balancer Service
。 Load balancer Service
would have an External IP, point all your cluster traffic to that IP. Load balancer Service
将具有外部IP,将所有群集流量指向该IP。 So your traffic would go through the following pipeline: 因此,您的流量将通过以下管道:
all traffic -> AWS LoadBalancer -> Node1:xxxx -> Nginx-Ingress-Controller Service -> Nginx-Ingress-Controller Pod -> Your Service1 (based on your ingress rules) -> Your Pod
所有流量 - > AWS LoadBalancer - > Node1:xxxx - > Nginx-Ingress-Controller服务 - > Nginx-Ingress-Controller Pod - >您的Service1(根据您的入口规则) - >您的Pod
Here is an example how to bring up a Nginx-Ingress-Controller: https://hackernoon.com/setting-up-nginx-ingress-on-kubernetes-2b733d8d2f45 以下是如何启动Nginx-Ingress-Controller的示例: https : //hackernoon.com/setting-up-nginx-ingress-on-kubernetes-2b733d8d2f45
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.