-
Notifications
You must be signed in to change notification settings - Fork 0
/
configmap.yml
53 lines (53 loc) · 1.51 KB
/
configmap.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-nginx-controller
annotations:
# use the shared ingress-nginx
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/configuration-snippet: |
internal;
rewrite ^ $original_uri break;
nginx.ingress.kubernetes.io/server-snippet: |
location /api/does/not/matter/much {
if ( $request_method = GET) {
set $target_destination '/_get';
}
if ( $request_method = POST) {
set $target_destination '/_post';
}
if ( $request_method = PUT) {
set $target_destination '/_put';
}
if ( $request_method = DELETE) {
set $target_destination '/_delete';
}
set $original_uri $uri;
rewrite ^ $target_destination last;
}
spec:
ingressClassName: nginx
rules:
- host: myserviceb.foo.org
http:
paths:
- path: /_get
backend:
serviceName: get-service
servicePort: 8080
- path: /_post
backend:
serviceName: post-service
servicePort: 8080
- path: /_put
backend:
serviceName: put-service
servicePort: 8080
- path: /_delete
backend:
serviceName: delete-service
servicePort: 8080