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

  • 相关阅读:
    搜刮一些开源项目的APP
    iOS Crash文件的解析
    iOS中RGB颜色转换
    随笔杂记
    iOS字体
    方法总结
    经验点滴
    个人理解
    OC 知识点回顾
    IOS UI 笔记整理回顾
  • 原文地址:https://www.cnblogs.com/reatual/p/14617302.html
Copyright © 2011-2022 走看看