zoukankan      html  css  js  c++  java
  • Liveness and readiness

    1. 什么是Liveness?什么只readiness?

    如:liveness:   

    K8S 通过Liveness探针来检测容器/pod是否在正常运行,如果探测失败,会主动重启容器/pod

    readiness与liveness类似,只有容器/pod满足条件时,才会作为后端的endpoint point提供服务,readiness没有就绪时,容器/pod只会按计划启动,但并不会提供服务。

    readiness与liveness类似,三种方式。

    2. 三种探测方式

    a. exec

    如:

    livenessProbe:
        exec:
          command:
          - /bin/sh
          - -c
          - /health/healthcheck.sh
         failureThreshod: 3
         initialDelaySeconds: 45
         PeriodSeconds: 5
         successThreshold: 1
         timeoutSeconds: 10

    在容器中运行命令,返回0代表正常,非0表示失败,则触发重启

    b. httpGeet

    如:http-get http://:8080/actuator/health delay=120s timeout=5s period=10s #success=1

    通过发起换一个http get request,根据返回状态码,来判断成功还是失败

    c. tcpSocket

    顾名思义,对指定tcp 端口进行探测。

  • 相关阅读:
    the Agiles Scrum Meeting 8
    the Agiles Scrum Meeting 7
    the Agiles Scrum Meeting 6
    项目使用说明——英文版
    第十次例会
    第九次例会
    第八次例会
    第六次例会
    第七次例会
    第五次例会
  • 原文地址:https://www.cnblogs.com/reatual/p/14617302.html
Copyright © 2011-2022 走看看