liveBook · Manning

Ingressclass

As explained in Kubernetes in Action, Second Edition

An IngressClass is a Kubernetes API resource that identifies the ingress controller responsible for processing Ingress objects and can provide controller parameters.

An IngressClass is a Kubernetes API resource that identifies the ingress controller responsible for processing an Ingress. It can also point to controller-specific configuration parameters. section 12.5

Use an IngressClass to:

  • Select among multiple ingress controllers by setting an Ingress object's spec.ingressClassName to the desired class name. section 12.5 section 12.5.2
  • Identify the controller through spec.controller, such as k8s.io/ingress-nginx. section 12.5.1
  • Provide different configurations or ingress flavors by referencing a controller-specific parameters object. section 12.5.3
  • Choose a cluster default by marking one class with ingressclass.kubernetes.io/is-default-class: "true"; unclassified Ingress objects then use it. section 12.5.2

Reference a class from an Ingress

apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: kiada spec: ingressClassName: nginx rules: ... An IngressClass named nginx can select the k8s.io/ingress-nginx controller. List available classes with kubectl get ingressclasses. section 12.5.1 section 12.5.2

Figure 12.9 The relationship between Ingresses, IngressClasses, and ingress controllers
figure

Trace how Ingress objects reference IngressClasses, which identify the ingress controllers that process them. section 12.5

An IngressClass does not define parameter fields itself because each controller has different configuration needs. Instead, it references a controller-specific object by API group, kind, and name; Kubernetes does not interpret that object's contents. section 12.5.3

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains class discovery, YAML fields, Ingress references, defaults, and parameter objects, stopping short of controller-specific parameter schemas.
Examples
Uses nginx class discovery, an ingressClassName manifest, and an AWS IngressClassParams object with load-balancer settings.
What it assumes
Assumes familiarity with Kubernetes Ingress objects and controllers while introducing class discovery, references, defaults, and parameters.
What you can do after
Operate/configure Ingress routing by selecting a class, inspecting available classes, and linking controller parameters.
How it connects
Connects Ingress objects, ingress controllers, defaulting, annotations, and controller-specific custom Kubernetes objects.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.