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:
Go to the TCA UI.
For TCA Manager
Click the login user icon on the top-right corner of the screen.
Select the Open Cluster Terminal option.
For TCA-CP
Go to Virtual Infrastructure tab and select the VIM.
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:
Go to the TCA UI.
For TCA Manager
Click the login user icon in the top-right corner of the screen.
Select the Open VM Terminal option.
Execute
debug-tca-cluster
command.
For TCA-CP
Go to Virtual Infrastructure tab and select the VIM.
Right-click and select the Open VM Terminal option.
Execute
debug-tca-cluster
command.
From the SSH terminal:
Login to the TCA/TCA-CP using SSH.
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:
Tail logs (10 lines)
Tail logs
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:
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/