fix ingress syntax. (#7867)

This commit is contained in:
counter2015 2021-11-02 08:12:58 +08:00 committed by GitHub
parent e34ca93ad6
commit ed34f6c93d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 204 additions and 105 deletions

View file

@ -74,9 +74,13 @@ spec:
- host: app.example.com
http:
paths:
- backend:
serviceName: example-service
servicePort: fastcgi
- path: /
pathType: Prefix
backend:
service:
name: example-service
port:
name: fastcgi
```
## FastCGI Ingress Annotations

View file

@ -27,9 +27,12 @@ spec:
http:
paths:
- path: /foo/.*
pathType: Prefix
backend:
serviceName: test
servicePort: 80
service:
name: test
port:
number: 80
```
The preceding ingress definition would translate to the following location block within the NGINX configuration for the `test.com` server:
@ -61,13 +64,19 @@ spec:
http:
paths:
- path: /foo/bar
pathType: Prefix
backend:
serviceName: service1
servicePort: 80
service:
name: service1
port:
number: 80
- path: /foo/bar/
pathType: Prefix
backend:
serviceName: service2
servicePort: 80
service:
name: service2
port:
number: 80
```
```yaml
@ -83,9 +92,12 @@ spec:
http:
paths:
- path: /foo/bar/(.+)
pathType: Prefix
backend:
serviceName: service3
servicePort: 80
service:
name: service3
port:
number: 80
```
The ingress controller would define the following location blocks, in order of descending length, within the NGINX template for the `test.com` server:
@ -137,13 +149,19 @@ spec:
http:
paths:
- path: /foo/bar/bar
pathType: Prefix
backend:
serviceName: test
servicePort: 80
service:
name: test
port:
number: 80
- path: /foo/bar/[A-Z0-9]{3}
pathType: Prefix
backend:
serviceName: test
servicePort: 80
service:
name: test
port:
number: 80
```
The ingress controller would define the following location blocks (in this order) within the NGINX template for the `test.com` server:

View file

@ -189,10 +189,13 @@ In the Zipkin interface we can see the details:
- host: example.com
http:
paths:
- backend:
serviceName: echoheaders-x
servicePort: 80
path: /echo
- path: /echo
pathType: Prefix
backend:
service:
name: echoheaders-x
port:
number: 80
' | kubectl apply -f -
```