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 committed by Simon Zeltser
parent 4ac66b072a
commit 781cdaed9e
9 changed files with 73 additions and 1 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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