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
780434fc
Commit
780434fc
authored
Jul 01, 2019
by
xuezj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
健康检查支持定制
parent
5a4c7af6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
index.js
config/index.js
+3
-0
service.js
kubeService/service.js
+8
-2
No files found.
config/index.js
View file @
780434fc
...
@@ -10,5 +10,8 @@ module.exports = {
...
@@ -10,5 +10,8 @@ module.exports = {
imageDomain
:
'
ccr.ccs.tencentyun.com
'
,
imageDomain
:
'
ccr.ccs.tencentyun.com
'
,
path
:
'
/v2/index.php
'
,
path
:
'
/v2/index.php
'
,
domain
:
'
.lkbang.com
'
,
domain
:
'
.lkbang.com
'
,
noHealthCheckApp
:
[
'
acs-batch
'
,
'
acs-quartz
'
,
'
acs-service
'
,
'
pcm
'
,
'
talos
'
,
'
app-server
'
]
}
}
kubeService/service.js
View file @
780434fc
...
@@ -6,6 +6,7 @@ const moment = require('moment')
...
@@ -6,6 +6,7 @@ const moment = require('moment')
const
yaml
=
require
(
'
js-yaml
'
)
const
yaml
=
require
(
'
js-yaml
'
)
const
logger
=
require
(
'
koa-log4
'
).
getLogger
(
'
kubeService
'
)
const
logger
=
require
(
'
koa-log4
'
).
getLogger
(
'
kubeService
'
)
const
yamls
=
require
(
'
../yamls
'
)
const
yamls
=
require
(
'
../yamls
'
)
const
APP_CONFIG
=
require
(
'
../config
'
)
const
client
=
new
Client
({
const
client
=
new
Client
({
config
:
config
.
fromKubeconfig
(
config
:
config
.
fromKubeconfig
(
...
@@ -51,8 +52,13 @@ const serviceCreate = async (data) => {
...
@@ -51,8 +52,13 @@ const serviceCreate = async (data) => {
break
;
break
;
case
'
Deployment
'
:
case
'
Deployment
'
:
logger
.
info
(
'
创建deploy
'
,
JSON
.
stringify
(
jsonObj
))
let
obj
=
jsonObj
await
client
.
apis
.
apps
.
v1beta1
.
namespaces
(
namespace
).
deployments
.
post
({
body
:
jsonObj
})
if
(
APP_CONFIG
.
noHealthCheckApp
.
includes
(
serviceName
))
{
obj
=
_
.
omit
(
jsonObj
,
[
'
spec.template.spec.containers[0].readinessProbe
'
])
}
logger
.
info
(
'
创建deploy
'
,
serviceName
,
JSON
.
stringify
(
obj
))
await
client
.
apis
.
apps
.
v1beta1
.
namespaces
(
namespace
).
deployments
.
post
({
body
:
obj
})
break
;
break
;
case
'
PersistentVolumeClaim
'
:
case
'
PersistentVolumeClaim
'
:
...
...
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