ingress-controller and Google kubernetes

10/14/2019

I have created an ingress resource in my Kubernetes cluster on google cloud.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: gordion
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    kubernetes.io/ingress.global-static-ip-name: gordion-ingress
    networking.gke.io/managed-certificates: gordion-certificate,gordion-certificate-backend
spec:
  rules:
  - host: backend.gordion.io
    http:
      paths:
      - path: /
        backend:
          serviceName: backend
          servicePort: 80

Everything works. However, I have not created any ingress-controller. the official docs state that it must have it.

You must have an ingress controller to satisfy an Ingress. Only creating an Ingress resource has no effect.

So where is my ingress-controller if my routing actually works? how do I see its configuration?

-- LiranC
google-cloud-platform
google-kubernetes-engine
kubernetes

3 Answers

10/14/2019

In GKE, if you do not specify the kubernetes.io/ingress.class: nginx annotation, the GCE L7 load balancer controller (GLBC) will be used by default (it is actually equivalent to setting kubernetes.io/ingress.class: gce). This controller will be automatically provisioned and will rely on GCP's global HTTP(s) load balancer.

You can find more information on this topic on the GLBC GitHub's page as well as in this How-To article.

-- Nicolas Heitz
Source: StackOverflow

10/14/2019

In Google Kubernetes Engine (GKE), when you create an Ingress object, the built-in GKE ingress controller will take care of creating the appropriate HTTP(S) load balancer which conforms to your Ingress and its Service(s). For more information, have a look at this Google Cloud Document on "HTTP(S) load balancing with Ingress".

-- Vivak P
Source: StackOverflow

10/14/2019

Yes your ingress will work like this if you give it a NodePort service and a service behind... But you could have only created a LoadBalancer service and have the same result.

If you don't have any ingress-controller some of your configuration is not good as you are referencing some nginx ingress controller configuration (the rewrite).

The aim of an ingress controller is to load balance http-traffic for multiple apps inside your cluster, meaning, you only create one provider (here GCP) LB for multiple domains/path. This allows you to make some finops, not having multiple public IP and LB resources created for each of your apps.

In the documentation you posted in the pre-requisites that you mentionned there is a list of available solution like nginx-ingress controller, traefik....

How to use them:

  • First create an ingress like you did, remove the nginx rewrite and put * to hosts (that's a default conf for example)
  • Once the controller is up, for each app needing to have a path to the internet create an ingress with your ingress-specific annotations.
-- night-gold
Source: StackOverflow