Skip to content

Commit

Permalink
add cGroupOverrides to the legacy config (elastic#77180)
Browse files Browse the repository at this point in the history
* add  cGroupOverrides to the legacy config

* update missing usages

* remove old cpu/cgroup schema
  • Loading branch information
pgayvallet committed Sep 11, 2020
1 parent d683d01 commit 13b9a4f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -284,4 +286,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} "$@"
20 changes: 4 additions & 16 deletions src/legacy/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -145,6 +129,10 @@ export default () =>

ops: Joi.object({
interval: Joi.number().default(5000),
cGroupOverrides: Joi.object().keys({
cpuPath: Joi.string().default(),
cpuAcctPath: Joi.string().default(),
}),
}).default(),

plugins: Joi.object({
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/server/status/lib/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 13b9a4f

Please sign in to comment.