3 Using Debug Tool

Overview

The Debug Tools provides third party troubleshooting tools for debugging the runtime issues for lab and production environment. Following are the available tools:
  • tcpdump
  • ip
  • netstat
  • curl
  • ping
  • dig

Running the Debug Tool

Note:

While testing in OCCNE environment, check the Kyverno policies and make sure to exclude the namespace in the disallow-capabilities.
To run the debug tool:
  1. Execute the following command to retrieve the POD details:
    $ kubectl get pods -n <k8s namespace>
    After installation the debug-tool container will get injected into the pods, sample get pod output is here :
    [root@master ~]# kubectl get po -n occm-ns
    NAME                        READY   STATUS    RESTARTS   AGE
    occm-occm-58db58648-d44kp   2/2     Running   0          13h
  2. Run the following command to enter Debug Tools Container:
    $ kubectl exec -it <pod name> -c <debug_container name> -n <namespace> bash
    For example:
    $ kubectl exec -it occm-occm-58db58648-d44kp -c tools -n occm-ns bash
  3. Execute the debug tools:
    bash -4.2$ <debug_tools>
    For example:
    bash -4.2$ tcpdump
  4. Copy the output files from container to host:
    $ kubectl cp -c <debug_container name> <pod name>:<file location in container> -n <namespace> <destination location>
    For example:
    $ kubectl cp -c tools -n occm-ns occm-occm-58db58648-d44kp:/tmp/capture.pcap /tmp/

Enable Debug Tools

Debug tools container can be enabled/disabled for OCCM by using helm install or helm upgrade command.

Run the following command to enable/disable OCCM after updating custom-occm_values.yaml file on an installed setup:
$ helm upgrade <release_name> -f custom_occm_values-<version>.yaml  <helm-repo> --version <helm_version>
For Example:
$ helm upgrade occm -f custom-occm_values_<version>.yaml  ocspf-helm-repo/occm --version 24.1.0