Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tke-eos
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
tke-eos
Commits
a2f08518
Commit
a2f08518
authored
Mar 18, 2019
by
薛智杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'kewei' into 'master'
删除服务,更新服务,重启服务,更新策略等功能 See merge request !3
parents
e46d3e95
9b0bbbed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
service.js
app/service.js
+8
-0
tke.clusterService.js
services/tke.clusterService.js
+10
-1
No files found.
app/service.js
View file @
a2f08518
...
...
@@ -51,3 +51,11 @@ router.post('/modifyImage', async ctx => {
await
ctx
.
cluster
.
service_modifyImage
(
ctx
.
request
.
body
.
serviceName
,
ctx
.
request
.
body
.
image
,
ctx
.
request
.
body
.
namespace
)
ctx
.
body
=
ctx
.
ok
(
'
更新成功
'
)
})
router
.
post
(
'
/instance
'
,
async
ctx
=>
{
let
data
=
await
ctx
.
cluster
.
instance_get
(
ctx
.
request
.
body
.
serviceName
,
ctx
.
request
.
body
.
namespace
)
ctx
.
body
=
ctx
.
ok
(
data
)
})
router
.
post
(
'
/redeploy
'
,
async
ctx
=>
{
await
ctx
.
cluster
.
service_redeployment
(
ctx
.
request
.
body
.
serviceName
,
ctx
.
request
.
body
.
namespace
)
ctx
.
body
=
ctx
.
ok
(
'
服务重部署成功
'
)
})
services/tke.clusterService.js
View file @
a2f08518
...
...
@@ -31,6 +31,10 @@ class Cluster extends Client {
params
.
clusterId
=
this
.
clusterId
let
str
=
JSON
.
stringify
(
params
)
await
this
.
post
(
'
CreateClusterService
'
,
params
)
// 腾讯云api暂只能通过修改服务来改成Recreate策略
let
modifyParams
=
JSON
.
parse
(
str
)
modifyParams
.
strategy
=
'
Recreate
'
await
this
.
post
(
'
ModifyClusterService
'
,
modifyParams
)
let
updateLabels
=
{
clusterId
:
params
.
clusterId
,
serviceName
:
params
.
serviceName
,
...
...
@@ -48,7 +52,12 @@ class Cluster extends Client {
service_modifyImage
(
serviceName
,
image
,
namespace
)
{
return
this
.
post
(
'
ModifyClusterServiceImage
'
,
{
serviceName
,
namespace
,
image
,
clusterId
:
this
.
clusterId
})
}
service_redeployment
(
serviceName
,
namespace
){
return
this
.
post
(
'
RedeployClusterService
'
,
{
serviceName
,
namespace
,
clusterId
:
this
.
clusterId
})
}
instance_get
(
serviceName
,
namespace
){
return
this
.
post
(
'
DescribeServiceInstance
'
,
{
serviceName
,
namespace
,
clusterId
:
this
.
clusterId
})
}
ingress_get
(
namespace
)
{
return
this
.
post
(
'
DescribeIngress
'
,
{
namespace
,
clusterId
:
this
.
clusterId
})
}
...
...
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