java-tutorials/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-selfhealing/object-configurations/readiness-example-k8s-templ...

54 lines
1.1 KiB
YAML
Raw Normal View History

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