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?
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.
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".
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: