How to increase the log level for Calico components
This document (000020063) is provided subject to the disclaimer at the end of this document.
Environment
Kubernetes cluster with the Calico Network Provider
Situation
During network troubleshooting it may be useful to increase the log level of the Calico components. This article details how to set verbose debug-level Calico component logging, in Rancher Kubernetes Engine (RKE) CLI or Rancher v2.x provisioned Kubernetes clusters.
Resolution
N.B.
As these instructions involve editing the Calico DaemonSet directly, the change
will not persist cluster update events As a result cluster updates should be
avoided whilst collecting the debug level logs for troubleshooting.
Via the Rancher UI
For a Rancher v2.x managed cluster, the Calico component log level can be adjusted via the Rancher UI, per the following process:
- Navigate to the
System
project of the relevant cluster within the Rancher UI. - Locate the calico DaemonSet workload within the
kube-system
namespace, click the vertical elipses (⋮
) and select Edit. - Click to Edit the
calico-node
container. - Add
CALICO_STARTUP_LOGLEVEL = DEBUG
,FELIX_LOGSEVERITYSCREEN = Debug
,BGP_LOGSEVERITYSCREEN = Debug
in Environment Variables section and clickSave
.
Via kubectl
With a Kube Config file sourced for the relevant cluster, for a user with permission to edit the System project, the Calico component log level can be adjusted via kubectl, per the following process:
- Run
kubectl -n kube-system edit daemonset calico-node
. - In the
env
definition for thecalico-node
container add an environment variable with the nameCALICO_STARTUP_LOGLEVEL
and valueDEBUG
,FELIX_LOGSEVERITYSCREEN
and valueDebug
andBGP_LOGSEVERITYSCREEN
and valueDebug
, e.g.:
[...]
containers:
- env:
[...]
- name: CALICO_STARTUP_LOGLEVEL
value: DEBUG
- name: BGP_LOGSEVERITYSCREEN
value: Debug
- name: FELIX_LOGSEVERITYSCREEN
value: Debug
[...]
- Save the file.
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.