Kubernetes入口处于创建状态

时间:2018-10-23 10:51:59

标签: kubernetes kubernetes-ingress google-kubernetes-engine nginx-ingress

我已经使用Google Kubernetes Engine部署了一个应用程序。所有功能均正常运行,但我遇到了一个奇怪的问题。如果我在Google云控制台中检查状态,则入口始终处于创建阶段。

您可以在图像中看到它:

您是否有解决建议?

谢谢

[编辑]

kubectl describe ingress: 
Name:             ++++++-nginx-ingress
Namespace:        ++++++
Address:
Default backend:  default-http-backend:80 (10.4.0.4:8080)
Rules:
  Host                        Path  Backends
  ----                        ----  --------
  ++++++-back.*******.net
                                 ++++++-nginx-np:80 (<none>)
  ++++++.*******.net
                                 ++++++-front-np:80 (<none>)
Annotations:
  ingress.kubernetes.io/backends:                    {"k8s-be-30141--93abcf3e6a0e0671":"HEALTHY","k8s-be-32338--93abcf3e6a0e0671":"HEALTHY","k8s-be-32589--93abcf3e6a0e0671":"HEALTHY"}
  ingress.kubernetes.io/url-map:                     k8s-um-++++++-++++++-nginx-ingress--93abcf3e6a0e0671
  kubectl.kubernetes.io/last-applied-configuration:  {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{"kubernetes.io/ingress.allow-http":"false","kubernetes.io/ingress.global-static-ip-name":"++++++-nginx-ingress-ip"},"labels":{"app":"++++++-nginx-ingress"},"name":"++++++-nginx-ingress","namespace":"++++++"},"spec":{"rules":[{"host":"++++++-back.*******.net","http":{"paths":[{"backend":{"serviceName":"++++++-nginx-np","servicePort":80}}]}},{"host":"++++++.*******.net","http":{"paths":[{"backend":{"serviceName":"++++++-front-np","servicePort":80}}]}}]}}

  kubernetes.io/ingress.allow-http:             false
  kubernetes.io/ingress.global-static-ip-name:  ++++++-nginx-ingress-ip
Events:   

                                  <none>

YAML文件:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 name: ++++++-nginx-ingress
 labels:
   app: ++++++-nginx-ingress
 annotations:
     kubernetes.io/ingress.global-static-ip-name: ++++++-nginx-ingress-ip
     kubernetes.io/ingress.allow-http: "false"
 namespace: ++++++
spec:
 rules:
 - host: ++++++-back.++++++.net
   http:
     paths:
     - backend:
         serviceName: ++++++-nginx-np
         servicePort: 80
 - host: ++++++.++++++.net
   http:
     paths:
     - backend:
         serviceName: ++++++-front-np
         servicePort: 80

1 个答案:

答案 0 :(得分:0)

检查输出,我发现在++++++-nginx-ingress-ip之后,负载平衡器未创建或没有获得静态IP Spec.Backend

status:
  loadBalancer:
    ingress:
    - ip: xx.xx.xx.xx

为入口配置TLS时,会使用注释kubernetes.io/ingress.allow-http: "false"

另一件事,您可能会检查是否在创建集群时默认启用了 L7 HTTP负载平衡插件