website/content/zh-cn/examples/pods/probe/pod-with-http-healthcheck.yaml

21 lines
444 B
YAML

apiVersion: v1
kind: Pod
metadata:
name: pod-with-http-healthcheck
spec:
containers:
- name: nginx
image: nginx
# 定义健康检查
livenessProbe:
# 一个 http 探针
httpGet:
path: /_status/healthz
port: 80
# Pod 启动之后,实施健康检查之前,
# 等待 Pod 初始化的时间长度
initialDelaySeconds: 30
timeoutSeconds: 1
ports:
- containerPort: 80