简体   繁体   English

Kubernetes负载平衡器没有标签选择器

[英]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: 要实现这一点,您需要创建:

  1. A Load Balancer Service with Nginx-Ingress-Controller pod as backend. 使用Nginx-Ingress-Controller pod作为后端的Load Balancer Service
  2. Your Load balancer Service would have an External IP, point all your cluster traffic to that IP. 您的Load balancer Service将具有外部IP,将所有群集流量指向该IP。
  3. Ingress rules that route all cluster traffic as you wish. 入口规则可根据需要路由所有群集流量。

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.

相关问题 Kubernetes中没有负载均衡器的Nginx入口控制器 - Nginx ingress controller without load balancer in Kubernetes Kubernetes Ingress控制器无负载均衡器 - Kubernetes Ingress Controller without Load Balancer 将负载均衡器与 Kubernetes 一起使用 - Using a Load Balancer with Kubernetes 检查 Kubernetes 中的负载均衡器 - Check Load Balancer in Kubernetes 如何在没有负载均衡器和入口 controller 的情况下将域指向 Kubernetes 集群 - How to point domain to Kubernetes cluster without Load Balancer and Ingress controller 在没有云提供商负载均衡器的情况下,将 kubernetes 集群暴露给“世界” - Exposing kubernetes clusteer to “the world” without Load Balancer of cloud provider 如何在没有负载均衡器的情况下设置kubernetes nginx入口? - How to setup kubernetes nginx ingress without load balancer? 使用自定义域配置Kubernetes / Traefik,而无需使用外部负载均衡器 - Configure Kubernetes/Traefik with custom domain without the use of an external load balancer 没有故障转移/负载平衡器的情况下,使用kubeadm的Kubernetes是否可以实现高可用性? - Is Kubernetes high availability using kubeadm possible without failover/load balancer? 在没有 GCP 负载平衡器的情况下创建 kubernetes nginx 入口 - Create kubernetes nginx ingress without GCP load-balancer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM