If Ingress configurations create Ingress resources containing at least one identical Ingress rule (host, path and advanced conditions are all the same), a route rule conflict happens.
For those Ingress resources with route rule conflict, BFE Ingress Controller will follow first-created-resource-win principle and only takes the first created Ingress resource as valid.
This principle will be followed when route rule conflict happens within a namespace or across different namespaces.
For those invalid Ingress resources due to route rule conflict, error messages will be written to its annotation, see Ingress Status.
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-A
namespace: production
annotations:
kubernetes.io/ingress.class: bfe
spec:
rules:
- host: example.foo.com
http:
paths:
- path: /foo
pathType: Prefix
backend:
serviceName: service1
servicePort: 80
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-B
namespace: production
annotations:
kubernetes.io/ingress.class: bfe
spec:
rules:
- host: example.foo.com
http:
paths:
- path: /foo
pathType: Prefix
backend:
serviceName: service2
servicePort: 80
In above configuration, there is conflict between ingress-A and ingress-B, and ingress-A is created before ingress-B. So only ingress-A will be created and take effect.
If an Ingress resource is invalid due to route rule conflict, after the ingress status is written back, the status
in annotation
will be set as “fail”, and message
will tell which Ingress resource it has conflict with.
In previous example, annotation
for ingress status will be like:
metadata:
annotations:
bfe.ingress.kubernetes.io/bfe-ingress-status: |
{"status": "fail", "message": "conflict with production/ingress-A"}
For more information about ingress status, refer to ingress status。