k8s liveness readiness和lifecycle

liveness是应用存活探测,readiness是应用启动就绪探测,只有就绪后才分配流量

        livenessProbe:
          failureThreshold: 5
          initialDelaySeconds: 120
          periodSeconds: 15
          successThreshold: 1
          tcpSocket:
            port: 8080
          timeoutSeconds: 2
        readinessProbe:
          failureThreshold: 5
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 120
          periodSeconds: 15
          successThreshold: 1
          timeoutSeconds: 2

lifecycle 是启动和停止前执行脚本,postStart是启动前,preStop是停止前

        lifecycle:
          preStop:
            exec:
              command:
              - /bin/sh
              - -c
              - sleep 60
posted on 2022-05-30 17:37  每天进步一点点点点点  阅读(838)  评论(0)    收藏  举报