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

  • 相关阅读:
    python pandas写入excel文件
    Ubuntu Teamviewer安装使用
    Ubuntu18.04 有线无法正常上网(请读完全文再进行操作)
    2019/4/5 python正则表达式的中文文档
    2019/4/3 Python今日收获
    2019/3/28 Python今日收获
    2019/3/15 Python今日收获
    2019/3/9 Python今日收获
    2019/2/26 Python今日收获
    2019/2/19 Python今日收获
  • 原文地址:https://www.cnblogs.com/walkersss/p/11754466.html
Copyright © 2011-2022 走看看