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
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
