2018-07-26 04:22:00 +00:00
|
|
|
# Copyright 2018 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2018-06-26 18:01:24 +00:00
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: cartservice
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: cartservice
|
|
|
|
spec:
|
2018-07-02 19:41:33 +00:00
|
|
|
terminationGracePeriodSeconds: 5
|
2018-06-26 18:01:24 +00:00
|
|
|
containers:
|
|
|
|
- name: server
|
2018-08-04 18:23:35 +00:00
|
|
|
image: gcr.io/microservices-demo-app/cartservice
|
2018-06-26 18:01:24 +00:00
|
|
|
ports:
|
|
|
|
- containerPort: 7070
|
|
|
|
env:
|
|
|
|
- name: REDIS_ADDR
|
|
|
|
value: "redis-cart:6379"
|
2018-06-28 05:49:12 +00:00
|
|
|
- name: PORT
|
2018-06-26 18:01:24 +00:00
|
|
|
value: "7070"
|
2018-06-28 05:49:12 +00:00
|
|
|
- name: LISTEN_ADDR
|
2018-06-28 05:31:31 +00:00
|
|
|
value: "0.0.0.0"
|
2018-06-26 18:01:24 +00:00
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
cpu: 200m
|
|
|
|
memory: 64Mi
|
|
|
|
limits:
|
|
|
|
cpu: 300m
|
|
|
|
memory: 128Mi
|
2018-06-29 00:55:51 +00:00
|
|
|
readinessProbe:
|
2018-07-09 19:56:54 +00:00
|
|
|
initialDelaySeconds: 15
|
2018-07-08 00:10:52 +00:00
|
|
|
exec:
|
|
|
|
command: ["/cartservice_probe"]
|
2018-06-29 00:55:51 +00:00
|
|
|
livenessProbe:
|
2018-07-09 19:56:54 +00:00
|
|
|
initialDelaySeconds: 15
|
2018-07-08 00:10:52 +00:00
|
|
|
periodSeconds: 10
|
|
|
|
exec:
|
|
|
|
command: ["/cartservice_probe"]
|
2018-06-26 18:01:24 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: cartservice
|
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
|
|
|
selector:
|
|
|
|
app: cartservice
|
|
|
|
ports:
|
2018-07-08 00:10:52 +00:00
|
|
|
- name: grpc
|
|
|
|
port: 7070
|
2018-06-26 18:01:24 +00:00
|
|
|
targetPort: 7070
|