Sometimes it's useful to increase the log levels of the LINSTOR Controller, SatelliteSet, or CSI driver beyond the default "INFO" level. This article quickly shows you how to do that.
LINSTOR Operator version 1.7.1 added options that allow you to control the log level of the LINSTOR controller, LINSTOR SatelliteSet, and LINSTOR CSI driver. Earlier versions of the LINSTOR Operator do not support changing these log levels.
You can set these values during or after deployment. Depending on the log level’s verbosity it might consume storage quickly, so the default info level is recommended unless you’re troubleshooting something in particular.
Supported levels for logging are as followed in order from least to most verbose:
- error
- warn
- info
- debug
- trace
After following the version appropriate procedure below, you should see your pods restart. Afterwards you can verify the level by reviewing the pod’s logs, respectively.
💡 TIP: LINSTOR satellite pods might need to be restarted manually to read changes made to their configMaps. This can be done by deleting the satellite pods and allowing their respective pod controller to reschedule them.
LINSTOR Operator v1.x Procedure
To change the log level after LINSTOR has been deployed, the following command adjusting the level as needed for each component:
helm upgrade <release-name> linstor/linstor --reuse-values \
--set operator.controller.logLevel=trace \
--set operator.satelliteSet.logLevel=trace \
--set csi.logLevel=trace
You might use the same command to return the log levels to their default level (info) once you’re finished troubleshooting:
helm upgrade <release-name> linstor/linstor --reuse-values \
--set operator.controller.logLevel=info \
--set operator.satelliteSet.logLevel=info \
--set csi.logLevel=info
LINSTOR Operator v2.x Procedure
To change the log level after LINSTOR has been deployed, apply the following patches, adjusting the log levels as needed for each component:
---
apiVersion: piraeus.io/v1
kind: LinstorCluster
metadata:
name: linstorcluster
spec:
patches:
- target:
kind: Deployment
name: linstor-csi-controller
patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --log-level=trace
- target:
kind: DaemonSet
name: linstor-csi-node
patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --log-level=trace
- target:
kind: ConfigMap
name: linstor-controller-config
patch: |
apiVersion: v1
kind: ConfigMap
metadata:
name: linstor-controller-config
data:
linstor.toml: |
[db]
connection_url = "k8s"
[logging]
linstor_level = "TRACE"
---
apiVersion: piraeus.io/v1
kind: LinstorSatelliteConfiguration
metadata:
name: all-satellites
spec:
patches:
- target:
kind: ConfigMap
name: satellite-config
patch: |
apiVersion: v1
kind: ConfigMap
metadata:
name: satellite-config
data:
linstor_satellite.toml: |
[logging]
linstor_level = "TRACE"
To revert back to the default log levels (info), the following patch can be applied.
apiVersion: piraeus.io/v1
kind: LinstorCluster
metadata:
name: linstorcluster
spec:
patches:
- target:
kind: Deployment
name: linstor-csi-controller
patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --log-level=info
- target:
kind: DaemonSet
name: linstor-csi-node
patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --log-level=info
- target:
kind: ConfigMap
name: linstor-controller-config
patch: |
apiVersion: v1
kind: ConfigMap
metadata:
name: linstor-controller-config
data:
linstor.toml: |
[db]
connection_url = "k8s"
[logging]
linstor_level = "INFO"
---
apiVersion: piraeus.io/v1
kind: LinstorSatelliteConfiguration
metadata:
name: all-satellites
spec:
patches:
- target:
kind: ConfigMap
name: satellite-config
patch: |
apiVersion: v1
kind: ConfigMap
metadata:
name: satellite-config
data:
linstor_satellite.toml: |
[logging]
linstor_level = "INFO"
Edited 2023/08/01 – MDK