zoukankan      html  css  js  c++  java
  • pod健康检测 exec/http/tcpSocket

    pod健康检测 方法:
    exec
    http
    tcpSocket


    1) liveness-exec.yaml

    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: liveness-exec
      labels:
        app: liveness
    spec:
      containers:
      - name: liveness
        image: busybox
        args:
        - /bin/sh
        - -c
        - touch /tmp/healthy;sleep 30; rm -rf /tmp/healthy; sleep 600
        livenessProbe:
          exec:
            command:
            - cat
            - /tmp/healthy
          initialDelaySeconds: 5
          periodSeconds: 5



    2)liveness-http.yaml

    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: liveness-http
      labels:
        app: liveness
    spec:
      containers:
      - name: liveness
        image: cnych/liveness
        args:
        - /server
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 3

    3)tcpSocket方式检测

    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: liveness-readiness
      labels:
        app: liveness-readiness
    spec:
      containers:
      - name: liveness-readiness
        image: cnych/liveness
        args:
        - /server
        livenessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 5
        readinessProbe:
          tcpSocket:
            port:8080
          initialDelaySeconds: 3
          perioidSeconds: 3

  • 相关阅读:
    安装MySQL
    Apache安装与重启、启动失败
    MySQL重启
    数据库查询乱码
    MySQL数据表操作、查看mysql表的信息等
    rust学习之一:基本语法
    llvm clang的编译和安装
    Linux 性能分析60秒初步排除手段
    pahole编译过程libbpf: failed to find valid kernel BTF
    ipmitool常用指令测试大全
  • 原文地址:https://www.cnblogs.com/walkersss/p/11754466.html
Copyright © 2011-2022 走看看