|
| 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