K8s健康检查
HTTP
就绪
ReadinessProbe:spec.template.spec.containers[].readinessProbe
启动
StartupProbe:spec.template.spec.containers[].startupProbe
存活
LivenessProbe:spec.template.spec.containers[].livenessProbe
startupProbe:
failureThreshold: 3
httpGet:
path: /status
port: 80
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
failureThreshold: 2
httpGet:
path: /status
port: 80
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
readinessProbe:
failureThreshold: 3
httpGet:
path: /status
port: 80
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
TCP
startupProbe:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 2
initialDelaySeconds: 30
livenessProbe:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 2
readinessProbe:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 2
命令行
startupProbe:
exec:
command:
- /bin/grpc_health_probe
- '-addr=:80'
- '-connect-timeout=3s'
- '-rpc-timeout=3s'
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
livenessProbe:
exec:
command:
- /bin/grpc_health_probe
- '-addr=:80'
- '-connect-timeout=3s'
- '-rpc-timeout=3s'
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
name: beta-vipmanager-file-grpc
readinessProbe:
exec:
command:
- /bin/grpc_health_probe
- '-addr=:80'
- '-connect-timeout=3s'
- '-rpc-timeout=3s'
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
exec方式执行http
startupProbe:
exec:
command:
- curl
- '--fail'
- 'http://localhost:80/status'
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3