Troubleshooting of the cluster failure can be very demanding. After numerous unsuccessful attempts to fix the fault, we often report it to the support. VMware support, usually want from us to generate log bundle from that cluster.
In this article I will show easy way how to generate diagnostic log bundle from a Tanzu Kubernetes Guest Cluster (TKGs).
1. Download required files
In this example, I will use my TKGs cluster – vmattroman-cl01
1. At first, we need to download binaries to collect logs. Go to https://kb.vmware.com/s/article/80949 and choose a right version from the Attachments section.
2. Unpack (untar) downloaded package with a command: tar -xvzf [file-name]
3. Go to the tkc-support-bundler folder.
4. For this step, remember to have a Docker running on your machine.
Download tkc-support-bundler docker image using docker pull command.
This image is necessary to run collecting logs script.
docker pull projects.registry.vmware.com/tkg/tkc-support-bundler:v1.4.0
2. Collect TKGs cluster logs
1. Log in to the Supervisor and set context to the Supervisor endpoint.
2. Now, we’re ready to start task to generate logs. Depending on your needs, you can use more flags. All of them, are given in the KB from the 1st step.
In this case, I want to generate standard logs using this flags:
./tkc-support-bundler -> downloaded script for logs collection
-k -> absolute path to supervisor cluster kubeconfig file on my machine
-o -> output directory where logs package will be stored
-c -> name of the TKGs cluster
-n -> namespace/vSphere namespace where cluster is running
./tkc-support-bundler create -k /Users/mateusz/.kube/config -o /Users/mateusz/Downloads/Tanzu/tkc-logs/tkc-support-bundler/ -c vmattroman-cl01 -n ns01
3. Collecting logs in progress. Depending on the size of the cluster, it can take a different amount of time.
4. It’s done! Newly created package has a name [name_of_the_cluster–support-bundle–random-numbers–tar.gz]
Now you can attach this file to the VMware support ticket 😉