Skip to content

Commit e2848d6

Browse files
navingerSimon Zeltser
authored and
Simon Zeltser
committed
Create k8s-grpc-bookstore.yaml (GoogleCloudPlatform#1492)
* Create k8s-grpc-bookstore.yaml I'm in the process of adding a tutorial to the Endpoints gRPC docs for running the bookstore sample on Kubernetes (K8s). I need this file for the tutorial so that the only thing people have to configure is the SERVICE_NAME. * Added comments to explain the purpose of the files.
1 parent 2e8a380 commit e2848d6

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

endpoints/kubernetes/grpc-bookstore.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License
1414

15+
# Use this file to deploy the container for the grpc-bookstore sample
16+
# and the container for the Extensible Service Proxy (ESP) to
17+
# Google Kubernetes Engine (GKE).
18+
1519
apiVersion: v1
1620
kind: Service
1721
metadata:
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright 2018 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License
14+
15+
# Use this file to deploy the container for the grpc-bookstore sample
16+
# and the container for the Extensible Service Proxy (ESP) to a
17+
# Kubernetes cluster that is not on GCP.
18+
19+
apiVersion: v1
20+
kind: Service
21+
metadata:
22+
name: esp-grpc-bookstore
23+
spec:
24+
ports:
25+
# Port that accepts gRPC and JSON/HTTP2 requests over HTTP.
26+
- port: 80
27+
targetPort: 9000
28+
protocol: TCP
29+
name: http2
30+
selector:
31+
app: esp-grpc-bookstore
32+
type: LoadBalancer
33+
---
34+
apiVersion: extensions/v1beta1
35+
kind: Deployment
36+
metadata:
37+
name: esp-grpc-bookstore
38+
spec:
39+
replicas: 1
40+
template:
41+
metadata:
42+
labels:
43+
app: esp-grpc-bookstore
44+
spec:
45+
# [START secret-1]
46+
volumes:
47+
- name: service-account-creds
48+
secret:
49+
secretName: service-account-creds
50+
# [END secret-1]
51+
# [START service]
52+
containers:
53+
- name: esp
54+
image: gcr.io/endpoints-release/endpoints-runtime:1
55+
args: [
56+
"--http2_port=9000",
57+
"--service=SERVICE_NAME",
58+
"--rollout_strategy=managed",
59+
"--backend=grpc://127.0.0.1:8000",
60+
"--service_account_key=/etc/nginx/creds/service-account-creds.json"
61+
]
62+
# [END service]
63+
ports:
64+
- containerPort: 9000
65+
# [START secret-2]
66+
volumeMounts:
67+
- mountPath: /etc/nginx/creds
68+
name: service-account-creds
69+
readOnly: true
70+
# [END secret-2]
71+
- name: bookstore
72+
image: gcr.io/endpointsv2/python-grpc-bookstore-server:1
73+
ports:
74+
- containerPort: 8000

0 commit comments

Comments
 (0)