Skip to content

Commit c4c2152

Browse files
authored
Merge pull request #23100 from Cweiping/fix_ingress_format_error
upgrade example-ingress.yaml to file format
2 parents 13a0473 + a79db9d commit c4c2152

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

content/en/docs/tasks/access-application-cluster/ingress-minikube.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,31 +132,12 @@ The following file is an Ingress resource that sends traffic to your Service via
132132

133133
1. Create `example-ingress.yaml` from the following file:
134134

135-
```yaml
136-
apiVersion: networking.k8s.io/v1
137-
kind: Ingress
138-
metadata:
139-
name: example-ingress
140-
annotations:
141-
nginx.ingress.kubernetes.io/rewrite-target: /$1
142-
spec:
143-
rules:
144-
- host: hello-world.info
145-
http:
146-
paths:
147-
- path: /
148-
pathType: Prefix
149-
backend:
150-
service:
151-
name: web
152-
port:
153-
number: 8080
154-
```
135+
{{< codenew file="ingress/example-ingress.yaml" >}}
155136

156137
1. Create the Ingress resource by running the following command:
157138

158139
```shell
159-
kubectl apply -f example-ingress.yaml
140+
kubectl apply -f https://k8s.io/examples/ingress/example-ingress.yaml
160141
```
161142

162143
Output:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: example-ingress
5+
annotations:
6+
nginx.ingress.kubernetes.io/rewrite-target: /$1
7+
spec:
8+
rules:
9+
- host: hello-world.info
10+
http:
11+
paths:
12+
- path: /
13+
pathType: Prefix
14+
backend:
15+
service:
16+
name: web
17+
port:
18+
number: 8080

0 commit comments

Comments
 (0)