|
| 1 | +# Copyright 2016 Google Inc. All Rights Reserved. |
| 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 | +apiVersion: v1 |
| 16 | +kind: Service |
| 17 | +metadata: |
| 18 | + name: esp-echo |
| 19 | +spec: |
| 20 | + ports: |
| 21 | + - port: 80 |
| 22 | + targetPort: 8080 |
| 23 | + protocol: TCP |
| 24 | + name: http |
| 25 | + selector: |
| 26 | + app: esp-echo |
| 27 | + # Change this type to NodePort if you use Minikube. |
| 28 | + type: LoadBalancer |
| 29 | +--- |
| 30 | +apiVersion: extensions/v1beta1 |
| 31 | +kind: Deployment |
| 32 | +metadata: |
| 33 | + name: esp-echo |
| 34 | +spec: |
| 35 | + replicas: 1 |
| 36 | + template: |
| 37 | + metadata: |
| 38 | + labels: |
| 39 | + app: esp-echo |
| 40 | + spec: |
| 41 | + # [START secret-1] |
| 42 | + volumes: |
| 43 | + - name: service-account-creds |
| 44 | + secret: |
| 45 | + secretName: service-account-creds |
| 46 | + # [END secret-1] |
| 47 | + # [START service] |
| 48 | + containers: |
| 49 | + - name: esp |
| 50 | + image: gcr.io/endpoints-release/endpoints-runtime:1 |
| 51 | + args: [ |
| 52 | + "--http_port", "8080", |
| 53 | + "--backend", "127.0.0.1:8081", |
| 54 | + "--service", "SERVICE_NAME", |
| 55 | + "--rollout_strategy", "managed", |
| 56 | + "--service_account_key", "/etc/nginx/creds/service-account-creds.json", |
| 57 | + ] |
| 58 | + # [END service] |
| 59 | + ports: |
| 60 | + - containerPort: 8080 |
| 61 | + # [START secret-2] |
| 62 | + volumeMounts: |
| 63 | + - mountPath: /etc/nginx/creds |
| 64 | + name: service-account-creds |
| 65 | + readOnly: true |
| 66 | + # [END secret-2] |
| 67 | + - name: echo |
| 68 | + image: gcr.io/endpoints-release/echo:latest |
| 69 | + ports: |
| 70 | + - containerPort: 8081 |
0 commit comments