✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Kubernetes IngressClass Management

Kubernetes IngressClass Management defines how Ingress resources route traffic, specifying which controller handles incoming requests in a Kubernetes cluster.

Kubernetes IngressClass Management refers to the practice of defining, assigning, and maintaining IngressClass resources, the cluster-scoped objects that identify which controller implementation is responsible for a given Ingress, and the default-class behavior that determines what happens when an Ingress does not explicitly specify one.


IngressClass Structure

Controller Identification Field

An IngressClass resource's defining field is its controller string, a domain-prefixed identifier that a running Ingress controller matches against to determine which IngressClass objects, and therefore which Ingress resources, it is responsible for implementing. Management of this field requires using the exact identifier string documented by the specific controller in use, since a mismatch results in an IngressClass that no running controller claims.

Controller-Specific Parameters

An IngressClass can reference a parameters object pointing at a controller-specific configuration resource, allowing additional settings, such as load balancer scaling parameters or default TLS behavior, to be associated with a class rather than repeated across every Ingress that uses it.

IngressClass controller: example.com/ingress Parameters resource Matching controller

Default Class Assignment

Annotation-Based Default Marking

Exactly one IngressClass in a cluster can be marked as the default through a well-known annotation, which causes any Ingress resource created without an explicit ingressClassName to be treated as belonging to that default class. Management practice includes ensuring only one IngressClass ever carries this annotation, since having none leaves unclassified Ingress objects unimplemented, while having more than one produces ambiguous, undefined behavior.

Migration Implications of Changing the Default

Changing which IngressClass is marked default affects every existing Ingress resource that omits an explicit class reference, since their effective controller assignment shifts immediately, making this a change that IngressClass management should treat as a cluster-wide, carefully coordinated operation rather than a routine adjustment.


Multi-Controller Cluster Management

Assigning Classes to Distinct Use Cases

Clusters running multiple Ingress controllers, for example one optimized for internal traffic and another for external, internet-facing traffic, rely on distinct IngressClass objects to let application teams explicitly choose the appropriate controller for each Ingress, a management pattern that requires clear naming conventions and documentation so teams reliably select the correct class for their traffic's intended exposure.

Preventing Class Confusion

As the number of IngressClass objects grows, management includes maintaining clear ownership and purpose documentation for each one, since a poorly documented or ambiguously named class increases the risk of an application team selecting the wrong controller for their traffic's security or exposure requirements.


Lifecycle and Removal

Retiring an IngressClass Safely

Removing an IngressClass that still has Ingress resources referencing it leaves those Ingress objects unimplemented, since their referenced controller association becomes invalid; management practice requires migrating or updating all referencing Ingress resources before a class is deleted, and auditing beforehand to confirm no resource still depends on it.


Interaction With Gateway API Adoption

Parallel Existence With GatewayClass

As clusters begin adopting Gateway API alongside Ingress, IngressClass management increasingly involves coordinating with the analogous GatewayClass concept, since both serve a similar controller-selection purpose for their respective APIs, and clusters running both often need consistent naming and ownership conventions across the two to avoid operator confusion.