【发布时间】:2019-11-07 01:14:00
【问题描述】:
我使用 Terraform 创建了一个 AKS 集群。我希望集群有一个 LoadBalancer 和一个静态公共 IP,并且我希望它们预先存在于我的 Ingress Controller/LoadBalancer 服务定义中,因为我不希望它们由 Kubernetes 清单动态创建/删除。
因此,我还根据documentation recommendations,在节点资源组和 SKU basic 中使用 Terraform 创建了一个 LoadBalancer 和一个静态公共 IP,并将公共 IP 附加到 LB。
然后我创建了一个 LoadBalancer 类型的服务:
---
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
type: LoadBalancer
loadBalancerIP: 8.8.8.8 (the public static IP allocated by Terraform)
selector:
name: my-pods-selector
ports:
- name: my-port
protocol: TCP
port: 1234
targetPort: 1234
然后服务卡在 PENDING 状态,describe 给我这个:
$ kubectl describe svc my-service
[...]
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal EnsuringLoadBalancer 5s (x9 over 15m) service-controller Ensuring load balancer
Warning CreatingLoadBalancerFailed 4s (x9 over 15m) service-controller Error creating load balancer (will retry): failed to ensure load balancer for service my-service: timed out waiting for the condition
我无法在describe 命令输出中找到有关该错误的更多信息:
Error creating load balancer (will retry): failed to ensure load balancer for service my-service: timed out waiting for the condition
另外,如果不预先创建 LoadBalancer,而只创建公共 IP,LoadBalancer 是动态创建的,一切顺利。
问题是:如何使 Azure 成功(我缺少哪个配置参数?)使用预先存在的 LB?
- Kubernetes 版本:1.13.5
【问题讨论】:
标签: azure-aks