Manually collect TKG cluster logs from the TCA Control Plane VM
search cancel

Manually collect TKG cluster logs from the TCA Control Plane VM

book

Article ID: 399408

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

How to collect TKG cluster logs on TCA:

  • From the TCA-CP (Control plane) VM
    or
  • Any linux VM who has access to the clusters

Collect TCA ogs for:

  • Process, CPU, Memory, Network and Disk statistics
  • Operating system logs
  • All pods and container logs
  • IP address of the all pods
  • Resource configured and in use for the pods

Environment

TCA 2.x, 3.x

Resolution

  1. Connect to the TCA-CP where the clusters are deployed and change user to root:

    Note: Verify You're on the Correct TCA Control Plane (TCA-CP) and make sure make sure you have access to the capv user.

  2. Log in to the cluster using the capv user and the cluster’s floating IP without entering a password :

    ssh capv@<cluster-ip>

    1. To confirm the correct SSH key is being used login into management cluster and running this command below:

      kubectl get clusters -A

      kubectl get cluster -n <namespace> <cluster-name> -o yaml

    2. Look for the id_rsa.pub entry in the output. This public key should match the one configured in the TCA-CP under ~/.ssh/id_rsa.pub.

      Note: If you are running this script from a location where you don't have access to SSH keys you will need to enter the password for capv user.

  3. Download the attached tkg_logs.sh script

    Note: you will need to run this script as root user and logs will be generated in the /tmp directory.

  4. Make the script executable:

    chmod +x tkg_logs.sh

  5. Run the script and, when prompted, enter the floating IP address of the cluster from which you want to collect logs.

    ./tkg_logs.sh

Additional Information

If you create an ips.txt file, you can list multiple floating IP addresses logs will be collected for each cluster IP specified.

Example:

ips.txt

192.168.0.1
192.168.0.2

Attachments

tkg_logs.sh get_app