forked from pablokbs/peladonerd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
04-nginx-proxy.yaml
65 lines (62 loc) · 1.17 KB
/
04-nginx-proxy.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
volumeMounts:
- name: config
mountPath: /etc/nginx/conf.d
volumes:
- name: config
configMap:
name: nginx-config
items:
- key: proxy.conf
path: proxy.conf
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
proxy.conf: |-
server {
listen 80;
location /v1 {
proxy_pass http://hello-v1-svc;
# https://github.com/envoyproxy/envoy/issues/170
proxy_http_version 1.1;
}
location /v2 {
proxy_pass http://hello-v2-svc;
# https://github.com/envoyproxy/envoy/issues/170
proxy_http_version 1.1;
}
}
---
kind: Service
apiVersion: v1
metadata:
name: nginx-svc
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80