Ingress没有得到GKE和GCE的地址

Tim*_*ell 7 google-cloud-platform kubernetes google-kubernetes-engine

创建入口时,不会生成任何地址,从GKE仪表板查看时,它始终处于Creating ingress状态.描述入口并没有显示任何事件,我在GKE仪表板上看不到任何线索.

有没有人有类似的问题或有关如何调试的任何建议?

我的deployment.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mobile-gateway-ingress    
spec:
  backend:
    serviceName: mobile-gateway-service
    servicePort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: mobile-gateway-service
spec:
  ports:
  - protocol: TCP
    port: 80
    targetPort: 8080
  selector:
    app: mobile-gateway
  type: NodePort
---
apiVersion: apps/v1 
kind: Deployment
metadata:
  name: mobile-gateway-deployment
  labels:
    app: mobile-gateway
spec:
  selector:
    matchLabels:
      app: mobile-gateway
  replicas: 2
  template:
    metadata:
      labels:
        app: mobile-gateway
    spec:
      containers:
      - name: mobile-gateway
        image: eu.gcr.io/my-project/mobile-gateway:latest
        ports:
          - containerPort: 8080
Run Code Online (Sandbox Code Playgroud)

描述入口显示没有事件:

mobile-gateway ? kubectl describe ingress mobile-gateway-ingress                                                                                                                         git:master*
Name:             mobile-gateway-ingress
Namespace:        default
Address:
Default backend:  mobile-gateway-service:80 (10.4.1.3:8080,10.4.2.3:8080)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *     *     mobile-gateway-service:80 (10.4.1.3:8080,10.4.2.3:8080)
Annotations:
  kubectl.kubernetes.io/last-applied-configuration:  {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{},"name":"mobile-gateway-ingress","namespace":"default"},"spec":{"backend":{"serviceName":"mobile-gateway-service","servicePort":80}}}

Events:  <none>
hello ?
Run Code Online (Sandbox Code Playgroud)

使用简单的LoadBalancer服务,可以获得IP地址.问题仅在于入口资源.

Tim*_*ell 7

这种情况下的问题是我HttpLoadBalancing在创建集群时没有包含插件!我的错,但是肯定会有一个事件告诉我入口资源中的这个错误.

奇怪的是,当我创建一个新的群集来跟随教程cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer使用默认插件时HttpLoadBalancing,我发现了同样的问题.也许我没等多久?无论如何,现在我已经加入了插件.

  • `HttpLoadBalancing` 默认包含在集群中。如果您指定了 `--enable-addons` 标志,那么您可能还需要在其中列出此附加组件,但是如果您按照教程进行操作而不修改步骤,则应该获得此附加组件。 (2认同)