Merge pull request #23100 from Cweiping/fix_ingress_format_error
upgrade example-ingress.yaml to file format
This commit is contained in:
@@ -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:
|
1. Create `example-ingress.yaml` from the following file:
|
||||||
|
|
||||||
```yaml
|
{{< codenew file="ingress/example-ingress.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
|
|
||||||
```
|
|
||||||
|
|
||||||
1. Create the Ingress resource by running the following command:
|
1. Create the Ingress resource by running the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl apply -f example-ingress.yaml
|
kubectl apply -f https://k8s.io/examples/ingress/example-ingress.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user