Commit 6a217d78 authored by 黎博's avatar 黎博

kafka新增健康检查

parent 7adcecb9
...@@ -2314,6 +2314,12 @@ public class K8sService { ...@@ -2314,6 +2314,12 @@ public class K8sService {
List<EnvVar> envVarList = new ArrayList<>(); List<EnvVar> envVarList = new ArrayList<>();
envVarList.addAll(Arrays.asList(envVar1, envVar2, envVar3, envVar4, envVar5, envVar6)); envVarList.addAll(Arrays.asList(envVar1, envVar2, envVar3, envVar4, envVar5, envVar6));
Probe livenessProbe = new ProbeBuilder().withTcpSocket(
new TCPSocketActionBuilder().withPort(
new IntOrStringBuilder().withIntVal(9092).build())
.build())
.build();
Container container = new ContainerBuilder() Container container = new ContainerBuilder()
.withName("kafka") .withName("kafka")
.withImage("ccr.ccs.tencentyun.com/" + image) .withImage("ccr.ccs.tencentyun.com/" + image)
...@@ -2328,6 +2334,7 @@ public class K8sService { ...@@ -2328,6 +2334,7 @@ public class K8sService {
.withName("datadir") .withName("datadir")
.withMountPath("/var/lib/kafka") .withMountPath("/var/lib/kafka")
.build()) .build())
.withLivenessProbe(livenessProbe)
.build(); .build();
List<Container> containerList = new ArrayList<>(); List<Container> containerList = new ArrayList<>();
......
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