如何修复 nginx 入口的 "failed to ensure load balancer" 错误
How to fix "failed to ensure load balancer" error for nginx ingress
在 Azure 上使用 helm 和静态 ip 设置新的 nginx-ingress 时,nginx 控制器永远不会分配静态 IP。它总是说 <pending>
.
我安装 helm chart 如下 -
helm install stable/nginx-ingress --name <my-name> --namespace <my-namespace> --set controller.replicaCount=2 --set controller.service.loadBalancerIP="<static-ip-address>"
它说它安装正确,但也列出了一个错误
E0411 06:44:17.063913 13264 portforward.go:303] error copying from
remote stream to local connection: readfrom tcp4
127.0.0.1:57881->127.0.0.1:57886: write tcp4 127.0.0.1:57881->127.0.0.1:57886: wsasend: An established connection was aborted by the software in your host machine.
然后我执行 kubectl get all -n <my-namespace>
并且所有内容都正确列出,只是控制器的外部 IP 为 <pending>
。
然后我执行 kubectl describe -n <my-namespace> service/<my-name>-nginx-ingress-controller
并且此错误列在事件下 -
Warning CreatingLoadBalancerFailed 11s (x4 over 47s)
service-controller Error creating load balancer (will retry): failed
to ensure load balancer for service
my-namespace/my-name-nginx-ingress-controller: timed out waiting for the
condition.
谢谢你
对于你的问题,可能的原因是你的publicIP与AKS集群不在同一个资源组和区域。请参阅 Create an ingress controller with a static public IP address in Azure Kubernetes Service (AKS) 中的步骤。
您可以像这样通过 CLI 命令获取 AKS 组:
az aks show --resource-group myResourceGroup --name myAKSCluster --query nodeResourceGroup -o tsv
当你的publicIP在不同的组别和地区时,会和你一样报超时错误。
确保您的入口在节点资源组中,并且入口的 sku 是基本而非标准
在 Azure 上使用 helm 和静态 ip 设置新的 nginx-ingress 时,nginx 控制器永远不会分配静态 IP。它总是说 <pending>
.
我安装 helm chart 如下 -
helm install stable/nginx-ingress --name <my-name> --namespace <my-namespace> --set controller.replicaCount=2 --set controller.service.loadBalancerIP="<static-ip-address>"
它说它安装正确,但也列出了一个错误
E0411 06:44:17.063913 13264 portforward.go:303] error copying from remote stream to local connection: readfrom tcp4 127.0.0.1:57881->127.0.0.1:57886: write tcp4 127.0.0.1:57881->127.0.0.1:57886: wsasend: An established connection was aborted by the software in your host machine.
然后我执行 kubectl get all -n <my-namespace>
并且所有内容都正确列出,只是控制器的外部 IP 为 <pending>
。
然后我执行 kubectl describe -n <my-namespace> service/<my-name>-nginx-ingress-controller
并且此错误列在事件下 -
Warning CreatingLoadBalancerFailed 11s (x4 over 47s) service-controller Error creating load balancer (will retry): failed to ensure load balancer for service my-namespace/my-name-nginx-ingress-controller: timed out waiting for the condition.
谢谢你
对于你的问题,可能的原因是你的publicIP与AKS集群不在同一个资源组和区域。请参阅 Create an ingress controller with a static public IP address in Azure Kubernetes Service (AKS) 中的步骤。
您可以像这样通过 CLI 命令获取 AKS 组:
az aks show --resource-group myResourceGroup --name myAKSCluster --query nodeResourceGroup -o tsv
当你的publicIP在不同的组别和地区时,会和你一样报超时错误。
确保您的入口在节点资源组中,并且入口的 sku 是基本而非标准