gpt4 book ai didi

amazon-web-services - EKS : could not find any suitable subnets for creating the ELB

转载 作者:行者123 更新时间:2023-12-02 11:30:24 28 4
gpt4 key购买 nike

我正在尝试使用 loadBalancer 向外界公开服务类型服务。

为此,我关注了这个文档

https://aws.amazon.com/premiumsupport/knowledge-center/eks-kubernetes-services-cluster/

我的 loadbalancer.yaml看起来像这样

apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: LoadBalancer
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80

但是负载均衡器没有按预期创建我收到以下错误
Warning  SyncLoadBalancerFailed  8s (x3 over 23s)  service-controller  Error syncing load balancer: failed to ensure load balancer: could not find any suitable subnets for creating the ELB

似乎是因为子网标签中的一些问题要解决,但我的子网中有所需的标签
kubernetes.io/cluster/<cluster-name>. owned  
kubernetes.io/role/elb 1

但是,我仍然收到错误 could not find any suitable subnets for creating the ELB

最佳答案

默认情况下,AWS EKS 仅将负载均衡器附加到公有子网。为了在私有(private)子网中启动它,您不仅需要标记您的子网(看起来就像您所做的那样),还需要注释您的负载均衡器-

service.beta.kubernetes.io/aws-load-balancer-internal: "true"



您可以找到更多信息 here .

关于amazon-web-services - EKS : could not find any suitable subnets for creating the ELB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62468996/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com