Steps to Run AKO Operator in Debug Mode
search cancel

Steps to Run AKO Operator in Debug Mode

book

Article ID: 427220

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

  • Additional logging is required from the AKO (Avi Kubernetes Operator) for advanced troubleshooting and root cause analysis.
  • This article describes the supported method to enable DEBUG log level for the AKO Operator running in a TKGs (Tanzu Kubernetes Grid Service) cluster.
  • AKO operator pod runs inside vmware-system-ako namespace

    kubectl get pods -n vmware-system-ako
    NAME                                                       READY   STATUS    RESTARTS      AGE
    vmware-system-ako-ako-controller-manager-6c7d49b95-9k5gr   1/1     Running      0           52d

Environment

 

  • AKO Operator deployed in a TKGs cluster

 

Resolution

Enable Debug Logging for AKO Operator

AKO log level is controlled via the AviLoadBalancerConfig custom resource. To enable debug logging, update the logLevel field to DEBUG.

Important
Do not modify the avi-k8s-config ConfigMap directly.
Any manual changes to the ConfigMap will be overwritten by the AKO Operator.

 

Step 1: Log in to the Kubernetes Cluster

Ensure you are authenticated and have access to patch the custom resources.

 

Step 2: Patch the AviLoadBalancerConfig Resource

Update the logLevel to DEBUG using a patch operation.

 
kubectl patch AviLoadBalancerConfig <name>  --type merge -p '{"spec":{"logLevel":"DEBUG"}}'

Replace <name> with the name of your AviLoadBalancerConfig resource.

 

Note: No pod restart is required.

 

Verification

Confirm that the log level has been updated successfully.

 
kubectl get AviLoadBalancerConfig -o yaml | grep -i log

Expected output:

 
logLevel: DEBUG

Step 3: Collect the AKO logs

Once the issue is reproduced collect the Pod logs:

 kubectl logs vmware-system-ako-ako-controller-manager-6c7d49b95-9k5gr  -n vmware-system-ako --all-containers=true > /home/akologs.txt