Skip to main content
Version: main 🚧

Enable debug logging in vCluster

Debug logging helps troubleshoot issues in vCluster. Enabling debug logging in vCluster helps diagnose and resolve issues more effectively. Adding the DEBUG environment variable to the vCluster configuration increases log verbosity and provides deeper insights.

This guide demonstrates how to enable debug logging by changing the vCluster configuration.

Common issues to investigate​

Debug logs are particularly helpful for investigating:

  • Synchronization problems between vCluster and host cluster.
  • Authentication and authorization issues.
  • Resource creation failures.
  • Networking and connectivity problems.
  • API server request handling.

Configure debug logging​

  1. Edit the vCluster configuration.

    Open the configuration file vcluster.yaml or the Helm values file you used during installation.

  2. Add the debug flag.

    Modify the configuration to include the debug environment variable:

    controlPlane:
    statefulSet:
    env:
    - name: "DEBUG"
    value: "true"
  3. Apply the configuration.

    Run this command to apply the updated configuration:

    helm upgrade <vcluster-helm-release-name> loft/vcluster -n <vcluster-namespace> -f vcluster.yaml
    • Replace <vcluster-helm-release-name> and <vcluster-namespace> with your actual values.

View debug logs​

After enabling debug logging, view the logs with the following command:

kubectl logs -n <vcluster-namespace> <vcluster-pod-name>

You'll see more detailed logs that include DEBUG level information.