BretFisher / kubernetes-mastery

Kubernetes course on Udemy from @BretFisher and @jpetazzo
https://www.bretfisher.com/kubernetes-mastery/
Other
240 stars 192 forks source link

New Lecture on Ingress Classes #26

Open ivorscott opened 2 years ago

ivorscott commented 2 years ago

Add lecture or new section for ingress classes.

Ingress classes

Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class.

https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class

Default IngressClass

You can mark a particular IngressClass as default for your cluster. Setting the ingressclass.kubernetes.io/is-default-class annotation to true on an IngressClass resource will ensure that new Ingresses without an ingressClassName field specified will be assigned this default IngressClass.

https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class

DefaultBackend

An Ingress with no rules sends all traffic to a single default backend. The defaultBackend is conventionally a configuration option of the Ingress controller and is not specified in your Ingress resources.

If none of the hosts or paths match the HTTP request in the Ingress objects, the traffic is routed to your default backend.

spec:
  defaultBackend:
    service:
      name: nginx
      port:
        number: 80

Explain DefaultBackend Warning

If you don't have a defaultBackend on the ingress resources or the ingress controller you will see a warning when inspecting the ingress resources.

kubectl describe ingress 

Name: demo-app
Namespace: default
Address:
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends

https://github.com/nginxinc/kubernetes-ingress/issues/966

BretFisher commented 1 year ago

Kubernetes Mastery Original Q&A