Commit 0f2fe09c authored by 黎博's avatar 黎博

优化一下/service/create和/service/modify

parent 6a1fe51c
......@@ -122,6 +122,8 @@ public class K8sController {
}
// 新增Service
tkeService.createServiceByYaml(serviceCreateVo);
// 休眠3秒,防止创建服务的时候获取不到Service暴露的端口
Thread.sleep(5000);
// 新增Deployment
tkeService.createDeploymentByYaml(serviceCreateVo);
} catch (Exception e) {
......@@ -183,13 +185,14 @@ public class K8sController {
if (service == null) {
// 创建或替换Service
tkeService.createServiceByYaml(serviceCreateVo);
}
// 休眠5秒,防止服务启动时获取不到Service暴露出来的端口
try {
Thread.sleep(3000);
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
// 创建或替换Deployment
tkeService.createDeploymentByYaml(serviceCreateVo);
// 创建或替换Ingress
......
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