Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ingress is not getting address on GKE and GCE

When creating ingress, no address is generated and when viewed from GKE dashboard it is always in the Creating ingress status. Describing the ingress does not show any events and I can not see any clues on GKE dashboard.

Has anyone has a similar issue or any suggestions on how to debug?

My 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

Describing ingress shows no events:

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 ➤

With a simple LoadBalancer service, an IP address is given. The problem is only with the ingress resource.

like image 655
Tim Blackwell Avatar asked Jul 07 '18 14:07

Tim Blackwell


2 Answers

The problem in this case was I had did not include the addon HttpLoadBalancing when creating the cluster! My fault but was would have been noice to have an event informing me of this mistake in the ingress resource.

Strange that when I created a new cluster to follow the tutorial cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer using default addons including HttpLoadBalancing that I observed the same issue. Maybe I didn't wait long enough? Anyway, working now that I have included the addon.

like image 71
Tim Blackwell Avatar answered Oct 17 '22 19:10

Tim Blackwell


To complete the accepted answer, it's worth noting that it's possible to activate the addon on an already existing cluster (from the Google console).

However, it will restart your cluster with downtime (in my case, it took several minutes on an almost empty cluster). Be sure that's acceptable in your case, and do tests.

like image 34
toadjaune Avatar answered Oct 17 '22 19:10

toadjaune