diff --git a/CHANGELOG.md b/CHANGELOG.md index 398aa47..bf10350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial implementation ([#1]) +- Ability to configure kubelet loglevel ([#2]) [Unreleased]: https://github.com/appuio/component-openshift4-logging/compare/1eb1205088953592c6dbf82fe98662debe68571e...HEAD [#1]: https://github.com/appuio/component-openshift4-logging/pull/1 +[#2]: https://github.com/appuio/component-openshift4-logging/pull/2 diff --git a/class/defaults.yml b/class/defaults.yml index f87e018..97dd4e7 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -2,6 +2,7 @@ parameters: openshift4_logging: namespace: openshift-logging channel: '4.5' + kubelet_loglevel: 2 clusterLogging: managementState: Managed logStore: diff --git a/component/main.jsonnet b/component/main.jsonnet index 63df8e2..258631c 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -81,4 +81,33 @@ local clusterLoggingGroupVersion = 'logging.openshift.io/v1'; }, }, } for role in ['master', 'worker']], + '50_kubelet_env_config': [kube._Object('machineconfiguration.openshift.io/v1', 'MachineConfig', '50-' + role + '-kubelet-env-config') { + metadata+: { + labels+: { + 'machineconfiguration.openshift.io/role': role, + }, + }, + spec: { + config: { + ignition: { + version: '2.2.0', + }, + storage: { + files: [ + { + contents: { + // See https://access.redhat.com/solutions/4619431 + source: 'data:text/plain;charset=utf-8;base64,' + std.base64(||| + KUBELET_LOG_LEVEL=params.kubelet_loglevel + |||), + }, + filesystem: 'root', + mode: 420, + path: '/etc/kubernetes/kubelet-env', + }, + ], + }, + }, + }, + } for role in ['master', 'worker']], }