Skip to content

Instantly share code, notes, and snippets.

@a-patel
Created July 16, 2022 09:09
Show Gist options
  • Save a-patel/dd34f123ed4749fd75f2dfb24f2c9120 to your computer and use it in GitHub Desktop.
Save a-patel/dd34f123ed4749fd75f2dfb24f2c9120 to your computer and use it in GitHub Desktop.
Kubernetes - Probes (Liveness, Readiness, and Startup) Overview
apiVersion: v1
kind: Pod
metadata:
labels:
app: myapp
name: myapp
spec:
containers:
- name: myapp
image: k8s.gcr.io/myapp
livenessProbe:
httpGet:
path: /healthz
port: 8080
httpHeaders: # optional
- name: Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
startupProbe:
httpGet:
path: /healthz
port: 8080
# port: liveness-port, # way-2: for apply to all probes types
failureThreshold: 30
periodSeconds: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment