add ingress class support #1670
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add ingress class support
This change will add Ingress class support, the only supported field in IngressClass is the
controller
field. In the future, we'll leverage theparameters
field for more customizations.Behavior
If only
kubernete.io/ingress.class
annotations presents, we consider IngressClass matches this controller if--ingress-class
is specified with non-empty value, and it matches annotation value (when install via YAML/Helm, by default it's specified asalb
):--ingress-class
is specified with empty value, and annotation value is empty oralb
.If only
spec.ingressClassName
non-nil, we consider IngressClass matches this controller ifspec.controller
of IngressClass have valueingress.k8s.aws/alb
If both
kubernete.io/ingress.class
annotation presents andspec.ingressClassName
non-nil, we will favorkubernete.io/ingress.class
and issue a warning event to Ingress if match result conflicts.we do this to align with IngressSpec's recommendation:
For backwards compatibility, when that annotation is set, it must be given precedence over this field. The controller may emit a warning if the field and annotation have different values.
If neither
kubernete.io/ingress.class
annotation presents andspec.ingressClassName
non-nil, we consider IngressClass matches this controller if--ingress-class
is specified with empty valueFuture plans
kubernete.io/ingress.class
annotation support in future versions with default valuefalse
in future versions. (this will help us enforce permission control via IngressClass)true
post X versions.kubernete.io/ingress.class
post Y versions.spec.ingressClassName
. (i.e.kubernete.io/ingress.class
annotation absents)Note to reviewer: