Commit 780434fc authored by xuezj's avatar xuezj

健康检查支持定制

parent 5a4c7af6
...@@ -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'
]
} }
...@@ -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':
......
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