top of page
  • viquarmca

Collecting Kubernetes Log Bundles in TCA using TCA CP CLI

This blog will help you to use the TCA Central CLI to collect the Kubernetes logs bundles for a specific management cluster or workload cluster. Like mention before in the my previous blog Collecting of Kubernetes logs are only via TCA-CP GUI or CLI . lets dive in for the steps and see how it can be collecting for one Cluster or more than one Cluster .

  1. SSH into the TCA-CP appliance where the Management cluster is deployed .

  2. Switch to root by using su command and provide the root password. If we dont switch to root and run the ccli list mc command it will throw you the permission error like below, so make sure once you have ssh session with admin ,switch to root.

[admin@lab-tcacp ~]$ ccli list mc

Please switch to root user , ccli can be used only with root privilege

[admin@lab-tcacp ~]$

3. list the management cluster by running the below command

ccli list mc

4. We are collecting management cluster logs here , mc stands for management cluster. when i run the ccli list mc , it will list me my management cluster ,in my lab i have only 1 mgmt cluster .

[admin@lab-tcacp /home/admin]# ccli list mc

| 0 | blrlabmk001-tkgmgmt01| blrlabmk001-tkgmgmt01 | 74f1d317-aa64-4b8a-a0e8-176f997483dc | true | |
[root@lab-tcamanager /home/admin]#

now we know what is my management cluster name , index , id . to collect the logs of this particular Kubernetes management cluster we need to note the ID from the above output highlighted.

5. go to the path cd /opt/vmware/bin and run the below command

./ <fileName> <true/false> <true/false> <true/false> <true/false> <comma separated cluster IDs - Provide the "Kubernetes Cluster ID " is true>

Where the 1st <true/false> is to collect the Core TCA logs.

2nd <true/false> is to collect the Crash Log (true requires that Core TCA logs are collected).

3rd <true/false> is to collect Mongo Database dump.

4th <true/false> is to collect the Kubernetes logs for the clusters specified. It is not recommended to collect the logs for all clusters.

Provide the ID of the Kubernetes Cluster - you can reference the steps later in this document to obtain the Kubernetes cluster ID for your version of TCA

Example - exporting the TCA log and the Kubernetes logs for management cluster:

./ VMware-TCA-K8s-Mgmtlogs-19062022 false false false true "74f1d317-aa64-4b8a-a0e8-176f997483dc"

Note : since we wanted to only collect the k8s we made other parameters as false. if you want to collect TCA logs + k8s u just have to change the parameter from False to True , like wise same for Mongo DB and Crash log.

We are only collecting K8s mgmt logs . it will take a while to collect the logs , once its done the logs will be save in the location : /tmp/techsupport/

Example :

6. The logs will be placed in /tmp/tech-support.

Go to /tmp/techsupport/ and do ls . winscp to the tca-cp extract the logs and share with the support.

[admin@lab-tcacp /tmp/techsupport]# ls


[admin@lab-tcacp /tmp/techsupport]# ls -ltrh

total 59M

-rw----r-- 1 root root 59M Jun 19 03:10 tkglogs-19062022.tar.gz

7. if you have more than 1 Cluster and u want to generate two cluster logs at a time u can still do that just add the K8s cluster id like below

./ VMware-TCA-K8s-Mgmtlogs-19062022 true false false true "74f1d317-aa64-4b8a-a0e8-176f997483dc,88b0382f-ff40-4118-8d9b-b6e6fd1640aa".

There you have it. K8s logs collection procedure very simple and easy , nice Right?!

220 views0 comments


bottom of page