zoukankan      html  css  js  c++  java
  • 原创-k8s 存活探针,就绪探针与启动探针

    k8s使用存活探针livenessProbe进行pod存活性检测,使用就绪探针确保未就绪的pod不会被加入service的后端。启动探针确保程序启动后才开始剩下俩种探针的探测,启动探针一般用的比较少。

    使用示例:

    在spec.container下:

    ---

    tcp探测

            livenessProbe:

             failureThreshold: 3 /失败三次算真正失败

             initialDelaySeconds: 30 /第一次探测等待30秒

             periodSeconds: 10 /每次间隔10秒

             successThreshold: 1 /成功一次算真正成功

             tcpSocket:

               port: 10018 /tcp探测10018

             timeoutSeconds: 2 /2秒算超时

    ---

    http探测

        ports:

         - name: internal-port

           containerPort: 8080

           hostPort: 8080

     

        readinessProbe:

         failureThreshold: 5 /失败5次算真正失败

         httpGet:

           path: /health

           port: internal-port   /这里引用上面的ports信息

           scheme: HTTP

         initialDelaySeconds: 3 /第一次检测等待3秒

         periodSeconds: 5 /每次间隔5秒

         successThreshold: 1 /成功一次即成功

         timeoutSeconds: 1 /超时一秒失败一次

     

    ---

    命令探测

    livenessProbe:

         exec:

           command:

           - cat

           - /tmp/healthy

         initialDelaySeconds: 5 /第一次检测等待5秒

         periodSeconds: 5 /每5秒检测一次

     

     ---

    参考文档:https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/

  • 相关阅读:
    MySQL 资源大全中文版
    Linux性能实时监测工具 Netdata
    《Linux大棚》博客
    GNU bash实现机制与源代码简析
    C#+ArcGIS Engine 获取地图中选中的要素
    arcgis engine 获取高亮Feature、element
    DotNetBar 源码与安装版本
    ArcGIS 按多边形区域统计栅格影像的一些信息
    ArcGIS 空间查询
    55.npm install 报错 :stack Error: Can't find Python executable "python"
  • 原文地址:https://www.cnblogs.com/normanlin/p/14621408.html
Copyright © 2011-2022 走看看