The troubleshooting tool is used for connecting to the database, viewing the logs, and debugging a service.

Accessing troubleshooting tool

You can access troubleshooting tool by launching a debug pod in the following ways:

  • From the UI directly into debug pod:

  1. Go to the TCA UI.

  2. For TCA Manager

    1. Click the login user icon on the top-right corner of the screen.

    2. Select the Open Cluster Terminal option.

  3. For TCA-CP

    1. Go to Virtual Infrastructure tab and select the VIM.

    2. Right-click and select the Open Cluster Terminal option.

This directly launches a debug pod starts and enters its shell.

  • From the UI using VM terminal:

  1. Go to the TCA UI.

  2. For TCA Manager

    1. Click the login user icon in the top-right corner of the screen.

    2. Select the Open VM Terminal option.

    3. Execute debug-tca-cluster command.

  3. For TCA-CP

    1. Go to Virtual Infrastructure tab and select the VIM.

    2. Right-click and select the Open VM Terminal option.

    3. Execute debug-tca-cluster command.

  • From the SSH terminal:

  1. Login to the TCA/TCA-CP using SSH.

  2. Execute debug-tca-cluster command.

In the debug pod, various tools are installed for example, kubectl, vim, tcpdump, python, network debugging utilities, jdk, and debug scripts. These tools can help in debugging the pods.

Troubleshooting tool

Once the debug pod is launched, you can run the following command to see the troubleshoot menu:

debug-tca

Connecting to Postgres

Select the Connect to Postgres option from the debug command menu. After selecting the option, you need to select the database name with one of the following otions:

  • tca

  • ztp

After selecting the database name, user is directly attached to the postgres shell without using the user credentials or executing any bash commands.

Get logs of a service

When you select the Get logs of a service option, a followup question appears to select the namespace for the service. After selecting the question, you see the list of all the deployment and stateful sets present in the namespace. Select the service name from the list. You can use both up and down arrow keys or shortcuts from the keyboard to go to an option.

After you select the service name, following three options are displayed:

  1. Tail logs (10 lines)

  2. Tail logs

  3. Print all logs

  • Tail logs (10 lines): Tails 10 lines and follows the logs.

  • Tail logs: You can specify the number lines of the log . It by default tails 100 lines.

  • Print all logs: Prints all the logs.

Debug Service

After selecting the Debug service option, select the namespace and you can see all the running pods are listed. Select the pod and then select the target container. All all the running ephemeral containers are listed on that pod. You can also create a new ephemeral container. In case there is no ephemeral container available, continue. You will see the following disclaimer:

Caution:

Ephemeral containers consume the pod resources. If any operations inside ephemeral container consume more resources than pod limits, then pod will restart. Please check whether pod have free resources before proceeding. Do you wish to continue?

When you enter yes and select an existing container, it is attached with the pod. You can also create a new ephemeral container and then attach to it.

The ephemeral container shares the process namespace with the target container. This allows to run some commands in ephemeral container. However, the output is same as target pod.

# will give all the processes running in the target containerps -ef 
# heap dump can be taken for the java process of the target containersu - admin -c "/usr/local/bin/jdk-17.0.6/bin/jmap -dump:format=b,file=filename.hprof 8"
# ping will workping www.vmware.com                                                            # to take tcpdumptcpdump -i eth0
# also from ephemeral containers the volumes mounted to the target container are also accessible (volumes mounted with sub Path won't be accessible)# in tca-app pod volume is mounted at /opt/vmware/heap-dumps which will be accessible through ephemeral containerls /opt/vmware/heap-dumps/