Added ingressClassName: nginx to Ingress example, mentioned to the necessity of it and referenced to the section describing that further
parent
4d519daf9b
commit
e21f0563f3
|
@ -88,6 +88,15 @@ has all the information needed to configure a load balancer or proxy server. Mos
|
||||||
contains a list of rules matched against all incoming requests. Ingress resource only supports rules
|
contains a list of rules matched against all incoming requests. Ingress resource only supports rules
|
||||||
for directing HTTP(S) traffic.
|
for directing HTTP(S) traffic.
|
||||||
|
|
||||||
|
If the `ingressClassName` is omitted, a [default Ingress class](#default-ingress-class)
|
||||||
|
should be defined.
|
||||||
|
|
||||||
|
There are some ingress controllers, that work without the definition of a
|
||||||
|
default `IngressClass`. For example, the Ingress-NGINX controller can be
|
||||||
|
configured with a [flag](https://kubernetes.github.io/ingress-nginx/#what-is-the-flag-watch-ingress-without-class)
|
||||||
|
`--watch-ingress-without-class`. It is [recommended](https://kubernetes.github.io/ingress-nginx/#i-have-only-one-instance-of-the-ingresss-nginx-controller-in-my-cluster-what-should-i-do) though, to specify the
|
||||||
|
default `IngressClass` as shown [below](#default-ingress-class).
|
||||||
|
|
||||||
### Ingress rules
|
### Ingress rules
|
||||||
|
|
||||||
Each HTTP rule contains the following information:
|
Each HTTP rule contains the following information:
|
||||||
|
@ -266,6 +275,14 @@ an `ingressClassName` specified. You can resolve this by ensuring that at most 1
|
||||||
IngressClass is marked as default in your cluster.
|
IngressClass is marked as default in your cluster.
|
||||||
{{< /caution >}}
|
{{< /caution >}}
|
||||||
|
|
||||||
|
There are some ingress controllers, that work without the definition of a
|
||||||
|
default `IngressClass`. For example, the Ingress-NGINX controller can be
|
||||||
|
configured with a [flag](https://kubernetes.github.io/ingress-nginx/#what-is-the-flag-watch-ingress-without-class)
|
||||||
|
`--watch-ingress-without-class`. It is [recommended](https://kubernetes.github.io/ingress-nginx/#i-have-only-one-instance-of-the-ingresss-nginx-controller-in-my-cluster-what-should-i-do) though, to specify the
|
||||||
|
default `IngressClass`:
|
||||||
|
|
||||||
|
{{< codenew file="service/networking/default-ingressclass.yaml" >}}
|
||||||
|
|
||||||
## Types of Ingress
|
## Types of Ingress
|
||||||
|
|
||||||
### Ingress backed by a single Service {#single-service-ingress}
|
### Ingress backed by a single Service {#single-service-ingress}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: IngressClass
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/component: controller
|
||||||
|
name: nginx-example
|
||||||
|
annotations:
|
||||||
|
ingressclass.kubernetes.io/is-default-class: "true"
|
||||||
|
spec:
|
||||||
|
controller: k8s.io/ingress-nginx
|
|
@ -5,6 +5,7 @@ metadata:
|
||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||||
spec:
|
spec:
|
||||||
|
ingressClassName: nginx-example
|
||||||
rules:
|
rules:
|
||||||
- http:
|
- http:
|
||||||
paths:
|
paths:
|
||||||
|
|
Loading…
Reference in New Issue