apiVersion: apps/v1
kind: Deployment
spec:
  replicas: 1
  template:
    spec:
      containers:
      - name: testLivenessProbe
        livenessProbe:        #容器健康检查(可选参数)
          httpGet:
            path: /healthz
            port: 80        #与容器端口保持一致
            scheme: HTTP
          initialDelaySeconds: 30
          timeoutSeconds: 2
          periodSeconds: 10
          failureThreshold: 3        #最少连续探测失败多少次才被认定为失败
        readinessProbe:        #容器启动检查(可选参数)
          httpGet:
            path: /healthz
            port: 80        #与容器端口保持一致
            scheme: HTTP
          initialDelaySeconds: 30
          timeoutSeconds: 2
          periodSeconds: 10
          failureThreshold: 3        #最少连续探测失败多少次才被认定为失败`在这里插入代码片`
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐