k8s启动、就绪、存活探针

The kubelet uses startup probes to know when a container application has started. If such a probe is configured, liveness and readiness probes do not start until it succeeds, making sure those probes don’t interfere with the application startup. This can be used to adopt liveness checks on slow starting containers, avoiding them getting killed by the kubelet before they are up and running.

启动探针:即探测容器是否启动起来。然后才会启用就绪探针和存活探针。

使用场景:容器启动时间较长时,防止被就绪探针或存活探针(启动时长超过延迟探测时长)探测失败重启容器;通过提高启动探针探测频率,能够能及时的启动容器,而不是通过预估延迟探测时间。

启动探针探测时长:failureThreshold * periodSeconds。最长5min。

启动探针配置如下:
启动探针配置

		startupProbe:
            failureThreshold: 30
            httpGet:
              path: /actuator/health
              port: 8079
              scheme: HTTP
            initialDelaySeconds: 3
            periodSeconds: 5
            successThreshold: 1
            timeoutSeconds: 1

或者简单的使用tcp端口探活:

		startupProbe:
            failureThreshold: 30
            initialDelaySeconds: 3
            periodSeconds: 5
            successThreshold: 1
            tcpSocket:
              port: 8079
            timeoutSeconds: 1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值