Add example for the IngressClass usage
This commit is contained in:
parent
69c0f38305
commit
235d1d655d
1 changed files with 27 additions and 1 deletions
|
@ -264,7 +264,33 @@ Otherwise, Ingresses missing the annotation, having an empty value, or with the
|
||||||
the new `IngressClass` resource can be leveraged to identify Ingress objects that should be processed.
|
the new `IngressClass` resource can be leveraged to identify Ingress objects that should be processed.
|
||||||
In that case, Traefik will look for an `IngressClass` in the cluster with the controller value equal to *traefik.io/ingress-controller*.
|
In that case, Traefik will look for an `IngressClass` in the cluster with the controller value equal to *traefik.io/ingress-controller*.
|
||||||
|
|
||||||
Please see [this article](https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/) for more information.
|
Please see [this article](https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/) for more information or the example below.
|
||||||
|
|
||||||
|
```yaml tab="IngressClass"
|
||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
kind: IngressClass
|
||||||
|
metadata:
|
||||||
|
name: traefik-lb
|
||||||
|
spec:
|
||||||
|
controller: traefik.io/ingress-controller
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Ingress"
|
||||||
|
apiVersion: "networking.k8s.io/v1beta1"
|
||||||
|
kind: "Ingress"
|
||||||
|
metadata:
|
||||||
|
name: "example-ingress"
|
||||||
|
spec:
|
||||||
|
ingressClassName: "traefik-lb"
|
||||||
|
rules:
|
||||||
|
- host: "*.example.com"
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: "/example"
|
||||||
|
backend:
|
||||||
|
serviceName: "example-service"
|
||||||
|
servicePort: 80
|
||||||
|
```
|
||||||
|
|
||||||
### `ingressEndpoint`
|
### `ingressEndpoint`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue