|
| 1 | +# Copyright 2018 Google LLC |
| 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: apps/v1 |
| 16 | +kind: Deployment |
| 17 | +metadata: |
| 18 | + name: checkoutservice |
| 19 | +spec: |
| 20 | + selector: |
| 21 | + matchLabels: |
| 22 | + app: checkoutservice |
| 23 | + template: |
| 24 | + metadata: |
| 25 | + labels: |
| 26 | + app: checkoutservice |
| 27 | + spec: |
| 28 | + serviceAccountName: default |
| 29 | + securityContext: |
| 30 | + fsGroup: 1000 |
| 31 | + runAsGroup: 1000 |
| 32 | + runAsNonRoot: true |
| 33 | + runAsUser: 1000 |
| 34 | + containers: |
| 35 | + - name: server |
| 36 | + securityContext: |
| 37 | + allowPrivilegeEscalation: false |
| 38 | + capabilities: |
| 39 | + drop: |
| 40 | + - all |
| 41 | + privileged: false |
| 42 | + readOnlyRootFilesystem: true |
| 43 | + image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.4.0 |
| 44 | + ports: |
| 45 | + - containerPort: 5050 |
| 46 | + readinessProbe: |
| 47 | + exec: |
| 48 | + command: ["/bin/grpc_health_probe", "-addr=:5050"] |
| 49 | + livenessProbe: |
| 50 | + exec: |
| 51 | + command: ["/bin/grpc_health_probe", "-addr=:5050"] |
| 52 | + env: |
| 53 | + - name: PORT |
| 54 | + value: "5050" |
| 55 | + - name: PRODUCT_CATALOG_SERVICE_ADDR |
| 56 | + value: "productcatalogservice:3550" |
| 57 | + - name: SHIPPING_SERVICE_ADDR |
| 58 | + value: "shippingservice:50051" |
| 59 | + - name: PAYMENT_SERVICE_ADDR |
| 60 | + value: "paymentservice:50051" |
| 61 | + - name: EMAIL_SERVICE_ADDR |
| 62 | + value: "emailservice:5000" |
| 63 | + - name: CURRENCY_SERVICE_ADDR |
| 64 | + value: "currencyservice:7000" |
| 65 | + - name: CART_SERVICE_ADDR |
| 66 | + value: "cartservice:7070" |
| 67 | + - name: DISABLE_STATS |
| 68 | + value: "1" |
| 69 | + - name: DISABLE_TRACING |
| 70 | + value: "1" |
| 71 | + - name: DISABLE_PROFILER |
| 72 | + value: "1" |
| 73 | + resources: |
| 74 | + requests: |
| 75 | + cpu: 100m |
| 76 | + memory: 64Mi |
| 77 | + limits: |
| 78 | + cpu: 200m |
| 79 | + memory: 128Mi |
| 80 | +--- |
| 81 | +apiVersion: v1 |
| 82 | +kind: Service |
| 83 | +metadata: |
| 84 | + name: checkoutservice |
| 85 | +spec: |
| 86 | + type: ClusterIP |
| 87 | + selector: |
| 88 | + app: checkoutservice |
| 89 | + ports: |
| 90 | + - name: grpc |
| 91 | + port: 5050 |
| 92 | + targetPort: 5050 |
0 commit comments