• 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 端口进行探测。

  • 相关阅读:
    第一次作业(2)
    第0次作业(2)
    最后一次作业—总结报告
    第八次作业
    第七周作业
    第六周作业
    第四周作业
    第4次作业
    2018c语言第3次作业
    2018c语言第2次作业
  • 原文地址:https://www.cnblogs.com/reatual/p/14617302.html
Copyright © 2020-2023  润新知