Key Concepts
IngressClass
A cluster-scoped resource that identifies an Ingress controller and its configuration.
Controller
The identifier of the Ingress controller that implements this class (e.g.,
k8s.io/ingress-nginx).Default Class
The IngressClass used when an Ingress doesn’t specify
ingressClassName.Parameters
Optional reference to a resource containing controller-specific configuration.
IngressClass is a cluster-scoped resource, meaning it applies to the entire cluster rather than a specific namespace.
Required Permissions
| Action | Permission |
|---|---|
| View ingressclasses | iam:project:infrastructure:kubernetes:read |
| Create ingressclass | iam:project:infrastructure:kubernetes:write |
| Edit ingressclass | iam:project:infrastructure:kubernetes:write |
| Delete ingressclass | iam:project:infrastructure:kubernetes:delete |
How to View Ingress Classes
How to View IngressClass Details
How to Create an IngressClass
Write YAML
Enter the IngressClass manifest in YAML format. Key fields:
spec.controller- Controller identifier (required)metadata.annotations- Include default class annotation if neededspec.parameters- Optional controller configuration reference
How to Edit an IngressClass
Modify Spec
Edit the IngressClass specification. Common changes:
- Set or remove default class annotation
- Update parameters reference
- Modify labels and annotations
How to Delete an IngressClass
Default IngressClass
One IngressClass can be marked as the cluster default. Ingresses that don’t specifyingressClassName will use the default class.
Setting the default:
| Annotation | Description |
|---|---|
ingressclass.kubernetes.io/is-default-class | Set to "true" to make this the default (recommended) |
kubernetes.io/ingress.class-default | Legacy annotation, also supported |
Only one IngressClass should be marked as default. If multiple are marked, behavior depends on the ingress controllers and Kubernetes version.
Controller Parameters
Parameters allow passing controller-specific configuration:| Field | Description |
|---|---|
| apiGroup | API group of the parameters resource |
| kind | Kind of the parameters resource |
| name | Name of the parameters resource |
| namespace | Namespace of the resource (for Namespace scope) |
| scope | Cluster for cluster-wide or Namespace for namespaced config |
Common Ingress Controllers
| Controller | Controller Value | Description |
|---|---|---|
| NGINX | k8s.io/ingress-nginx | Popular, feature-rich controller |
| Traefik | traefik.io/ingress-controller | Cloud-native, automatic HTTPS |
| HAProxy | haproxy.org/ingress-controller | High-performance load balancer |
| Contour | projectcontour.io/ingress-controller | Envoy-based controller |
| AWS ALB | ingress.k8s.aws/alb | AWS Application Load Balancer |
| GCE | gce.io/ingress-controller | Google Cloud Load Balancer |
Troubleshooting
Ingress not being handled
Ingress not being handled
- Verify the Ingress specifies the correct
ingressClassName - Check if the IngressClass exists and has the right controller
- Verify the controller pods are running
- Check if a default IngressClass is set for Ingresses without explicit class
Multiple controllers responding
Multiple controllers responding
- Ensure each Ingress specifies explicit
ingressClassName - Only mark one IngressClass as default
- Check for legacy
kubernetes.io/ingress.classannotations on Ingresses
Parameters not taking effect
Parameters not taking effect
- Verify the parameters resource exists
- Check apiGroup, kind, and name are correct
- Ensure the controller supports the parameter type
- Verify scope matches the resource location
Cannot delete IngressClass
Cannot delete IngressClass
- Check if Ingresses are still referencing this class
- Verify you have delete permission
- Check for finalizers blocking deletion
Default class not working
Default class not working
- Verify annotation key is exactly
ingressclass.kubernetes.io/is-default-class - Ensure value is the string
"true"(quoted) - Check Kubernetes version supports default IngressClass (1.19+)
- Verify only one IngressClass is marked as default
FAQ
Do I need an IngressClass?
Do I need an IngressClass?
Yes, for Kubernetes 1.19+. Each Ingress should specify an
ingressClassName or rely on a default IngressClass. Without one, Ingresses may not be handled.Can I have multiple IngressClasses?
Can I have multiple IngressClasses?
Yes. Multiple IngressClasses allow different controllers or configurations. Use
ingressClassName on each Ingress to select which class handles it.What happens if I delete an IngressClass?
What happens if I delete an IngressClass?
Existing Ingresses keep their reference but the controller won’t recognize them. Traffic routing stops until the IngressClass is recreated or Ingresses are updated.
How do I migrate from the legacy ingress.class annotation?
How do I migrate from the legacy ingress.class annotation?
Create an IngressClass with the matching controller and update Ingresses to use
spec.ingressClassName instead of the kubernetes.io/ingress.class annotation.Can I change the controller of an IngressClass?
Can I change the controller of an IngressClass?
No, the controller field is immutable. Delete the IngressClass and create a new one with the different controller.
What are parameters used for?
What are parameters used for?
Parameters reference a custom resource containing controller-specific configuration. For example, NGINX can reference a ConfigMap-like resource for global settings that apply to all Ingresses using this class.
Should I have a default IngressClass?
Should I have a default IngressClass?
It’s recommended for convenience. A default IngressClass handles Ingresses that don’t specify a class, reducing configuration burden and preventing unhandled Ingresses.
How do I know which controller handles an IngressClass?
How do I know which controller handles an IngressClass?
Check the
spec.controller field. This string identifies the controller that watches for Ingresses with this class. Each controller has a unique identifier.