Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cGroupOverrides to the legacy config #77180

Merged
merged 4 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +21 to 24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the new ones, but also kept the deprecated name to avoid a breaking change

csp.rules
Expand Down Expand Up @@ -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} "$@"
1 change: 1 addition & 0 deletions src/legacy/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export default () =>

ops: Joi.object({
interval: Joi.number().default(5000),
cGroupOverrides: HANDLED_IN_NEW_PLATFORM,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably remove old the schema up on lines 52-66 now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I had to add the explicit definition in ops though, as

cpuPath: this.config.get('ops.cGroupOverrides.cpuPath'),
cpuAcctPath: this.config.get('ops.cGroupOverrides.cpuAcctPath'),

is throwing error when trying to access the property if the schema is undefined (which make sense, HANDLED_IN_NEW_PLATFORM is only meant to be used for config values that are ONLY used in KP)

}).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