changed syntax from v1beta1 to v1 (#7362)

This commit is contained in:
Long 2021-07-16 17:08:09 +05:30 committed by GitHub
parent 1de9a24b28
commit 20b6202620
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ ingress-nginx can be used for many use cases, inside various cloud provider and
First of all follow the instructions to install ingress-nginx. Then imagine that you need to expose 2 HTTP services already installed: `myServiceA`, `myServiceB`. Let's say that you want to expose the first at `myServiceA.foo.org` and the second at `myServiceB.foo.org`. One possible solution is to create two **ingress** resources: First of all follow the instructions to install ingress-nginx. Then imagine that you need to expose 2 HTTP services already installed: `myServiceA`, `myServiceB`. Let's say that you want to expose the first at `myServiceA.foo.org` and the second at `myServiceB.foo.org`. One possible solution is to create two **ingress** resources:
``` ```
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: ingress-myservicea name: ingress-myservicea
@ -18,11 +18,14 @@ spec:
http: http:
paths: paths:
- path: / - path: /
pathType: Prefix
backend: backend:
serviceName: myservicea service:
servicePort: 80 name: myservicea
port:
number: 80
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: ingress-myserviceb name: ingress-myserviceb
@ -35,9 +38,12 @@ spec:
http: http:
paths: paths:
- path: / - path: /
pathType: Prefix
backend: backend:
serviceName: myserviceb service:
servicePort: 80 name: myserviceb
port:
number: 80
``` ```
When you apply this yaml, 2 ingress resources will be created managed by the **ingress-nginx** instance. Nginx is configured to automatically discover all ingress with the `kubernetes.io/ingress.class: "nginx"` annotation. When you apply this yaml, 2 ingress resources will be created managed by the **ingress-nginx** instance. Nginx is configured to automatically discover all ingress with the `kubernetes.io/ingress.class: "nginx"` annotation.