fix example-ingress.yaml format error

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
pull/23100/head
Weiping Cai 2020-08-12 18:38:34 +08:00
parent 7a7b6789b8
commit a79db9d5de
No known key found for this signature in database
GPG Key ID: 97CBE6D7C8EBC386
2 changed files with 20 additions and 21 deletions

View File

@ -132,31 +132,12 @@ The following file is an Ingress resource that sends traffic to your Service via
1. Create `example-ingress.yaml` from the following file:
```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: hello-world.info
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 8080
```
{{< codenew file="ingress/example-ingress.yaml" >}}
1. Create the Ingress resource by running the following command:
```shell
kubectl apply -f example-ingress.yaml
kubectl apply -f https://k8s.io/examples/ingress/example-ingress.yaml
```
Output:

View File

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: hello-world.info
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 8080