Commit 84d7fc69 authored by 黎博's avatar 黎博

修改健康检查

parent 247b02ab
...@@ -690,14 +690,14 @@ public class K8sService { ...@@ -690,14 +690,14 @@ public class K8sService {
Probe livenessProbe = new Probe(); Probe livenessProbe = new Probe();
livenessProbe.setExec(execAction); livenessProbe.setExec(execAction);
// 启动延时,容器延时启动健康检查的时间 // 启动延时,容器延时启动健康检查的时间
livenessProbe.setInitialDelaySeconds(300); livenessProbe.setInitialDelaySeconds(600);
// 间隔时间,进行健康检查的时间间隔 // 间隔时间,进行健康检查的时间间隔
livenessProbe.setPeriodSeconds(60); livenessProbe.setPeriodSeconds(60);
// 响应超时,每次健康检查响应的最大超时时间 // 响应超时,每次健康检查响应的最大超时时间
livenessProbe.setTimeoutSeconds(5); livenessProbe.setTimeoutSeconds(5);
// 健康阈值,表示后端容器从失败到成功的连续健康检查成功次数 // 健康阈值,表示后端容器从失败到成功的连续健康检查成功次数
livenessProbe.setSuccessThreshold(1); livenessProbe.setSuccessThreshold(1);
// 不健康阈值,表示后端容器从成功到失败的连续健康检查成功次数 // 不健康阈值
livenessProbe.setFailureThreshold(5); livenessProbe.setFailureThreshold(5);
container.setLivenessProbe(livenessProbe); container.setLivenessProbe(livenessProbe);
...@@ -705,15 +705,15 @@ public class K8sService { ...@@ -705,15 +705,15 @@ public class K8sService {
Probe readinessProbe = new Probe(); Probe readinessProbe = new Probe();
readinessProbe.setExec(execAction); readinessProbe.setExec(execAction);
// 启动延时 // 启动延时
readinessProbe.setInitialDelaySeconds(60); readinessProbe.setInitialDelaySeconds(15);
// 响应超时 // 响应超时
readinessProbe.setTimeoutSeconds(5); readinessProbe.setTimeoutSeconds(5);
// 间隔时间 // 间隔时间
readinessProbe.setPeriodSeconds(10); readinessProbe.setPeriodSeconds(5);
// 健康阈值 // 健康阈值
readinessProbe.setSuccessThreshold(1); readinessProbe.setSuccessThreshold(1);
// 不健康阈值,有些服务启动较慢,因此设置大一点 // 不健康阈值
readinessProbe.setFailureThreshold(30); readinessProbe.setFailureThreshold(3);
container.setReadinessProbe(readinessProbe); container.setReadinessProbe(readinessProbe);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment