Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
holmes
Commits
0f2fe09c
Commit
0f2fe09c
authored
May 21, 2022
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化一下/service/create和/service/modify
parent
6a1fe51c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
K8sController.java
src/main/java/cn/qg/holmes/controller/k8s/K8sController.java
+8
-5
No files found.
src/main/java/cn/qg/holmes/controller/k8s/K8sController.java
View file @
0f2fe09c
...
...
@@ -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
(
3
000
);
Thread
.
sleep
(
5
000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
// 创建或替换Deployment
tkeService
.
createDeploymentByYaml
(
serviceCreateVo
);
// 创建或替换Ingress
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment