Skip to content

Commit

Permalink
Fix api version for ingress objects on K8s version <1.19 (#8112)
Browse files Browse the repository at this point in the history
  • Loading branch information
tacf authored Jan 12, 2022
1 parent fc38b9f commit 5552fdf
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions docs/user-guide/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Let's say that you want to expose the first at `myServiceA.foo.org` and the seco
If cluster version < 1.19 you can create two **ingress** resources like this:

```
apiVersion: networking.k8s.io/v1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-myservicea
Expand All @@ -20,14 +20,11 @@ spec:
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: myservicea
port:
number: 80
serviceName: myservicea
servicePort: 80
---
apiVersion: networking.k8s.io/v1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-myserviceb
Expand All @@ -40,15 +37,12 @@ spec:
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: myserviceb
port:
number: 80
serviceName: myserviceb
servicePort: 80
```

If cluster version >= 1.19 the Ingress resource above will not work, instead of annotations you should use the new `ingressClassName: nginx` property.
If the cluster uses Kubernetes version >= 1.19.x, then its suggested to create 2 ingress resources, using yaml examples shown below. These examples are in conformity with the `networking.kubernetes.io/v1` api.

```
apiVersion: networking.k8s.io/v1
Expand Down

0 comments on commit 5552fdf

Please sign in to comment.