Commit 8a8219e8 authored by 黎博's avatar 黎博

修改下日志

parent 4f7c3afe
...@@ -9,6 +9,7 @@ import cn.qg.holmes.service.auth.TokenService; ...@@ -9,6 +9,7 @@ import cn.qg.holmes.service.auth.TokenService;
import cn.qg.holmes.service.k8s.*; import cn.qg.holmes.service.k8s.*;
import cn.qg.holmes.utils.MongoUtils; import cn.qg.holmes.utils.MongoUtils;
import cn.qg.holmes.utils.RedisUtils; import cn.qg.holmes.utils.RedisUtils;
import cn.qg.holmes.utils.YamlUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tencentcloudapi.tcr.v20190924.models.RepoInfo; import com.tencentcloudapi.tcr.v20190924.models.RepoInfo;
...@@ -121,9 +122,10 @@ public class K8sController { ...@@ -121,9 +122,10 @@ public class K8sController {
tkeService.createIngressByYaml(serviceCreateVo); tkeService.createIngressByYaml(serviceCreateVo);
} }
// 新增Service // 新增Service
tkeService.createServiceByYaml(serviceCreateVo); Service service = tkeService.createServiceByYaml(serviceCreateVo);
// 休眠3秒,防止创建服务的时候获取不到Service暴露的端口 // 休眠3秒,防止创建服务的时候获取不到Service暴露的端口
Thread.sleep(5000); Thread.sleep(5000);
log.info("/service/create创建Deployment前,Service状态:{}", YamlUtils.JsonToYamlStr(JSON.toJSONString(service)));
// 新增Deployment // 新增Deployment
tkeService.createDeploymentByYaml(serviceCreateVo); tkeService.createDeploymentByYaml(serviceCreateVo);
} catch (Exception e) { } catch (Exception e) {
...@@ -184,7 +186,7 @@ public class K8sController { ...@@ -184,7 +186,7 @@ public class K8sController {
Service service = tkeService.getServiceDetail(namespace, serviceName); Service service = tkeService.getServiceDetail(namespace, serviceName);
if (service == null) { if (service == null) {
// 创建或替换Service // 创建或替换Service
tkeService.createServiceByYaml(serviceCreateVo); service = tkeService.createServiceByYaml(serviceCreateVo);
} }
// 休眠5秒,防止服务启动时获取不到Service暴露出来的端口 // 休眠5秒,防止服务启动时获取不到Service暴露出来的端口
...@@ -193,6 +195,8 @@ public class K8sController { ...@@ -193,6 +195,8 @@ public class K8sController {
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
log.info("/service/modify创建Deployment前,Service状态:{}", YamlUtils.JsonToYamlStr(JSON.toJSONString(service)));
// 创建或替换Deployment // 创建或替换Deployment
tkeService.createDeploymentByYaml(serviceCreateVo); tkeService.createDeploymentByYaml(serviceCreateVo);
// 创建或替换Ingress // 创建或替换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