k8s: add liveness/readiness probes

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-06-28 17:55:51 -07:00
parent ca6e6647ef
commit ecba29655a
9 changed files with 73 additions and 1 deletions

View file

@ -27,6 +27,12 @@ spec:
limits:
cpu: 300m
memory: 128Mi
readinessProbe:
tcpSocket:
port: 7070
livenessProbe:
tcpSocket:
port: 7070
---
apiVersion: v1
kind: Service

View file

@ -13,6 +13,14 @@ spec:
image: checkoutservice
ports:
- containerPort: 5050
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 5050
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 5050
env:
- name: PRODUCT_CATALOG_SERVICE_ADDR
value: "productcatalogservice:3550"

View file

@ -13,6 +13,14 @@ spec:
image: currencyservice
ports:
- containerPort: 31337
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 31337
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 31337
resources:
requests:
cpu: 100m

View file

@ -12,7 +12,15 @@ spec:
- name: server
image: emailservice
ports:
- containerPort: 5000
- containerPort: 8080
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 8080
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 8080
resources:
requests:
cpu: 100m

View file

@ -13,6 +13,14 @@ spec:
image: paymentservice
ports:
- containerPort: 50051
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 50051
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 50051
resources:
requests:
cpu: 100m

View file

@ -13,6 +13,14 @@ spec:
image: productcatalogservice
ports:
- containerPort: 3550
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 3550
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 3550
resources:
requests:
cpu: 100m

View file

@ -13,6 +13,14 @@ spec:
image: recommendationservice
ports:
- containerPort: 8080
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 8080
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 8080
env:
- name: PRODUCT_CATALOG_SERVICE_ADDR
value: "productcatalogservice:3550"

View file

@ -11,6 +11,16 @@ spec:
containers:
- name: redis
image: redis:alpine
ports:
- containerPort: 6379
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 6379
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 6379
volumeMounts:
- mountPath: /data
name: redis-data

View file

@ -13,6 +13,14 @@ spec:
image: shippingservice
ports:
- containerPort: 50051
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 50051
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 50051
resources:
requests:
cpu: 100m