-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgke_config.yaml
62 lines (60 loc) · 1.52 KB
/
gke_config.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
apiVersion: v1
kind: Service
metadata:
name: mygrpcendpoint-loadbalancer
spec:
ports:
# Port that accepts gRPC and JSON/HTTP2 requests over HTTP.
- port: 8000
targetPort: 9000
protocol: TCP
name: http2
- port: 8001
targetPort: 9001
protocol: TCP
name: http1
selector:
app: mygrpcendpoint
type: LoadBalancer
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mygrpcendpoint
spec:
replicas: 1
template:
metadata:
labels:
app: mygrpcendpoint
spec:
volumes:
- name: nginx-config
configMap:
name: nginx-config
containers:
# doc here: https://cloud.google.com/endpoints/docs/specify-proxy-startup-options
- name: esp
image: b.gcr.io/endpoints/endpoints-runtime:1.0
args: [
"-P", "9000",
"-p", "9001",
"-s", "mygrpcendpoint.endpoints.MYPROJECTID.cloud.goog",
"-v", "apiversion", # will be substituded by the deploy script
"-a", "grpc://127.0.0.1:8000",
"-n", "/etc/nginx/custom/nginx.conf",
]
ports:
- containerPort: 8000
volumeMounts:
- mountPath: /etc/nginx/custom
name: nginx-config
readOnly: true
- name: mygrpcendpoint
image: gcr.io/MYPROJECTID/mygrpcendpoint:latest
ports:
- containerPort: 8000
- name: mygrpcendpoint-swaggerui
image: gcr.io/MYPROJECTID/mygrpcendpoint-swaggerui:latest
ports:
- containerPort: 9002