java-tutorials/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-selfhealing/object-configurations/liveness-example-k8s-templa...

54 lines
1.1 KiB
YAML
Raw Normal View History

apiVersion: v1
kind: Service
metadata:
name: liveness-example
spec:
selector:
app: liveness-example
ports:
- port: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: liveness-example
spec:
selector:
matchLabels:
app: liveness-example
replicas: 1
strategy:
rollingUpdate:
maxUnavailable: 0
template:
metadata:
labels:
app: liveness-example
spec:
containers:
- name: liveness-example
image: dbdock/liveness-example:1.0.0
imagePullPolicy: IfNotPresent
resources:
requests:
memory: 400Mi
cpu: 400m
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
timeoutSeconds: 2
periodSeconds: 3
failureThreshold: 1
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 20
timeoutSeconds: 2
periodSeconds: 8
failureThreshold: 1