Azure AKS:Kubernetes吊舱在分配静态IP后继续显示CrashLoopBackOff状态

Azure AKS:Kubernetes吊舱在分配静态IP后继续显示CrashLoopBackOff状态,azure,kubernetes,kubernetes-pod,azure-aks,Azure,Kubernetes,Kubernetes Pod,Azure Aks,您好,我正在遵循Microsoft上的以下指南,为我的AKS群集分配静态ip。然而,我面临着Kubernetes吊舱在分配静态IP后一直显示CrashLoopBackOff状态的问题 这是我创建的静态ip: 这些服务按预期工作: 错误的屏幕截图: 这是打印后的堆栈跟踪kubectl descripe pod Name: dashboardbackend-6d9d56bbfb-l5fbx Namespace: default Priority: 0 Node:

您好,我正在遵循Microsoft上的以下指南,为我的AKS群集分配静态ip。然而,我面临着Kubernetes吊舱在分配静态IP后一直显示CrashLoopBackOff状态的问题

这是我创建的静态ip:

这些服务按预期工作:

错误的屏幕截图:

这是打印后的堆栈跟踪
kubectl descripe pod

Name:         dashboardbackend-6d9d56bbfb-l5fbx
Namespace:    default
Priority:     0
Node:         aks-agentpool-40731879-vmss000000/10.240.0.4
Start Time:   Mon, 05 Oct 2020 02:16:25 +0800
Labels:       app=dashboardbackend
              pod-template-hash=6d9d56bbfb
Status:       Running
IP:           10.244.0.15
  IP:           10.244.0.15
Controlled By:  ReplicaSet/dashboardbackend-6d9d56bbfb
Containers:
    Container ID:   docker://83bf57b5f899ba57271b3be85054ea8e03b8e92b6d4dd21cb5623568c73ea030
    Image ID:       docker-pullable://julio02.azurecr.io/dashboardbackend@sha256:2ae7ed770fd890c147710e73245ece19958cbc8e0fcd8d5a3be716ef9c2a35de
    Port:           80/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Mon, 05 Oct 2020 02:17:01 +0800
      Finished:     Mon, 05 Oct 2020 02:17:09 +0800
    Ready:          False
    Restart Count:  2
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-lt49b (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  default-token-lt49b:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-lt49b
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason     Age                From                                        Message
  ----     ------     ----               ----                                        -------
  Normal   Scheduled  65s                default-scheduler                           Successfully assigned default/dashboardbackend-6d9d56bbfb-l5fbx to aks-agentpool-40731879-vmss000000
  Normal   Pulling    29s (x3 over 64s)  kubelet, aks-agentpool-40731879-vmss000000  Pulling image "julio02.azurecr.io/dashboardbackend:55"
  Normal   Pulled     29s (x3 over 63s)  kubelet, aks-agentpool-40731879-vmss000000  Successfully pulled image "julio02.azurecr.io/dashboardbackend:55"
  Normal   Created    29s (x3 over 60s)  kubelet, aks-agentpool-40731879-vmss000000  Created container dashboardbackend
  Normal   Started    29s (x3 over 59s)  kubelet, aks-agentpool-40731879-vmss000000  Started container dashboardbackend
  Warning  BackOff    5s (x3 over 42s)   kubelet, aks-agentpool-40731879-vmss000000  Back-off restarting failed container
名称:仪表板后端-6d9d56bbfb-l5fbx
名称空间:默认值
优先级:0
节点:aks-agentpool-40731879-VMSS00000/10.240.0.4
开始时间:2020年10月5日星期一02:16:25+0800
标签:app=dashboardbackend
pod模板哈希=6d9d56bbfb
状态:正在运行
IP:10.244.0.15
IP:10.244.0.15
控制人:ReplicaSet/dashboardbackend-6d9d56bbfb
容器:
容器ID:docker://83bf57b5f899ba57271b3be85054ea8e03b8e92b6d4dd21cb5623568c73ea030
图像ID:docker-pullable://julio02.azurecr.io/dashboardbackend@sha256:2ae7ed770fd890c147710e73245ece19958cbc8e0fcd8d5a3be716ef9c2a35de
端口:80/TCP
主机端口:0/TCP
国家:等待
原因:仓促退却
最后状态:终止
原因:错误
退出代码:1
开始时间:2020年10月5日星期一02:17:01+0800
完成时间:2020年10月5日星期一02:17:09+0800
就绪:错误
重新启动计数:2
环境:
挂载:
/来自default-token-lt49b(ro)的var/run/secrets/kubernetes.io/serviceCount
条件:
类型状态
初始化为True
准备错误
集装箱准备好了吗
播客预定为真
卷数:
default-token-lt49b:
类型:Secret(由Secret填充的卷)
SecretName:default-token-lt49b
可选:false
QoS等级:最佳努力
节点选择器:
容差:node.kubernetes.io/未就绪:不执行300秒
node.kubernetes.io/不可访问:不执行300秒
活动:
从消息中键入原因年龄
----     ------     ----               ----                                        -------
正常计划的65s默认计划程序已成功将默认/仪表板后端-6d9d56bbfb-l5fbx分配给aks-agentpool-40731879-VMSS00000
正常拉动29秒(x3/64秒)kubelet,aks-agentpool-40731879-VMSS00000拉动图像“julio02.azurecr.io/dashboardbackend:55”
正常拉取29秒(x3/63秒)kubelet,aks-agentpool-40731879-VMSS00000成功拉取图像“julio02.azurecr.io/dashboardbackend:55”
正常创建29秒(x3/60秒)kubelet,aks-agentpool-40731879-VMSS00000创建容器仪表板后端
正常启动29秒(x3/59秒)kubelet,aks-agentpool-40731879-VMSS00000启动容器仪表板后端
警告退避5s(x3/42s)kubelet,aks-agentpool-40731879-VMSS00000退避重新启动失败的容器

根据@Vitalli的请求,我在运行了创建的pod的Kubernetes日志后解决了问题。键入
kubectl日志[podname]
后,我意识到Azure SQL DB的ip地址没有添加到连接设置的白名单中。添加和删除pod后,它将重新创建pod,应用程序将按预期运行


查看kubectl logs Dashboard Backend-6d9d56bbfb-l5fbx的输出,谢谢,通过查看日志,它帮助解决了我的问题。谢谢你的帮助!您可以共享绑定到此pod的服务文件吗?您是直接公开服务还是通过ingress/traefik之类的负载平衡器公开服务?@Richard Rodjues您可以发布解决问题的答案吗?@Vitalii我已按要求发布了我的答案