From 8e6d2b0274fb601db786bccf28687b3f0f6300d2 Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Thu, 10 Sep 2020 16:27:34 +0200 Subject: [PATCH 1/3] add cGroupOverrides to the legacy config --- src/legacy/server/config/schema.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/legacy/server/config/schema.js b/src/legacy/server/config/schema.js index dd65e45659ffc..a9b26e1cfb1e3 100644 --- a/src/legacy/server/config/schema.js +++ b/src/legacy/server/config/schema.js @@ -144,6 +144,7 @@ export default () => ops: Joi.object({ interval: Joi.number().default(5000), + cGroupOverrides: HANDLED_IN_NEW_PLATFORM, }).default(), plugins: Joi.object({ From c528f24f8ba7fdb88c1f0c75898f2567ca053b0a Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Thu, 10 Sep 2020 17:14:45 +0200 Subject: [PATCH 2/3] update missing usages --- .../os_packages/docker_generator/resources/bin/kibana-docker | 4 +++- src/legacy/server/status/lib/metrics.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker index d7f137e965327..b02b7cc16ec4a 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker @@ -18,6 +18,8 @@ kibana_vars=( console.enabled console.proxyConfig console.proxyFilter + ops.cGroupOverrides.cpuPath + ops.cGroupOverrides.cpuAcctPath cpu.cgroup.path.override cpuacct.cgroup.path.override csp.rules @@ -279,4 +281,4 @@ umask 0002 # Therefore, we set this value here so that cgroup statistics are # available for the container this process will run in. -exec /usr/share/kibana/bin/kibana --cpu.cgroup.path.override=/ --cpuacct.cgroup.path.override=/ ${longopts} "$@" +exec /usr/share/kibana/bin/kibana --ops.cGroupOverrides.cpuPath=/ --ops.cGroupOverrides.cpuAcctPath=/ ${longopts} "$@" diff --git a/src/legacy/server/status/lib/metrics.js b/src/legacy/server/status/lib/metrics.js index 2631b245e72ab..478bf0829b1aa 100644 --- a/src/legacy/server/status/lib/metrics.js +++ b/src/legacy/server/status/lib/metrics.js @@ -116,8 +116,8 @@ export class Metrics { async captureCGroups() { try { const cgroup = await cGroupStats({ - cpuPath: this.config.get('cpu.cgroup.path.override'), - cpuAcctPath: this.config.get('cpuacct.cgroup.path.override'), + cpuPath: this.config.get('ops.cGroupOverrides.cpuPath'), + cpuAcctPath: this.config.get('ops.cGroupOverrides.cpuAcctPath'), }); if (isObject(cgroup)) { From 9e9993152399addb7836085a449ec6cff5d93438 Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Thu, 10 Sep 2020 20:53:56 +0200 Subject: [PATCH 3/3] remove old cpu/cgroup schema --- src/legacy/server/config/schema.js | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/legacy/server/config/schema.js b/src/legacy/server/config/schema.js index a9b26e1cfb1e3..ce7a500a00dc8 100644 --- a/src/legacy/server/config/schema.js +++ b/src/legacy/server/config/schema.js @@ -49,22 +49,6 @@ export default () => csp: HANDLED_IN_NEW_PLATFORM, - cpu: Joi.object({ - cgroup: Joi.object({ - path: Joi.object({ - override: Joi.string().default(), - }), - }), - }), - - cpuacct: Joi.object({ - cgroup: Joi.object({ - path: Joi.object({ - override: Joi.string().default(), - }), - }), - }), - server: Joi.object({ name: Joi.string().default(os.hostname()), // keep them for BWC, remove when not used in Legacy. @@ -144,7 +128,10 @@ export default () => ops: Joi.object({ interval: Joi.number().default(5000), - cGroupOverrides: HANDLED_IN_NEW_PLATFORM, + cGroupOverrides: Joi.object().keys({ + cpuPath: Joi.string().default(), + cpuAcctPath: Joi.string().default(), + }), }).default(), plugins: Joi.object({