【发布时间】:2019-06-25 16:41:43
【问题描述】:
我为我的资源组分配了一个 IP 地址,如下所示:
az network public-ip create --resource-group myResourceGroup --name ipName --allocation-method static
现在,我想将它分配给我的 AKS,所以我只是更改了 yaml,如下所示:
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
loadBalancerIP: xx.xx.xxx.xxx <--the ip generated before
type: LoadBalancer
ports:
- port: 80
selector:
app: nginx-sgr
然后我运行:
kubectl apply -f mykube.yaml
但它似乎卡住了:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx LoadBalancer 10.0.77.234 <pending> 80:32320/TCP 79m
通过执行 describe 我确实得到了以下信息:
Warning CreatingLoadBalancerFailed 21m (x19 over 86m) service-controller Error creating
load balancer (will retry): failed to ensure
load balancer for service default/nginx: user supplied IP Address
xx.xx.xxx.xxx was not found in resource group
MC_**myResourceGroup**_myAKSCluster_westeurope
请注意,它似乎在由我在第一个命令中指定的资源组(与 kubernates 相同)和其他信息组成的资源组中搜索...我做错了什么?
【问题讨论】:
-
能否通过命令
kubectl describe service nginx提供更多关于服务状态的详细信息? -
更新了!我想我现在知道原因,但我不知道如何解决它......