The NextGen gateway now includes a new debugging feature that allows you to troubleshoot Pods running on a Kubernetes Node, especially if they are experiencing crashes. To diagnose any connectivity problems from within the container, you can launch the Debug Container.

How to launch the Debug Container

Before you begin to launch the debug container:

  • The NextGen gateway Pod should be scheduled and running.
  • For the advanced debugging steps, you need to know which Node the Pod is running and must have shell access to run the commands on that Node.

Debugging with an ephemeral debug container

Ephemeral containers are useful for interactive troubleshooting when kubectl exec is insufficient because a container has crashed or a container image does not include debugging utilities.

OpsRamp provides a new debugger docker image that includes all necessary debugging utilities.

Example 1: Debug using ephemeral containers

You can add ephemeral containers to a running NextGen gateway Pod using the kubectl debug command. If you use the -i/--interactive argument, the kubectl command will automatically connect to the ephemeral container’s console.

kubectl debug -it nextgen-gw-0 --image=us-docker.pkg.dev/opsramp-registry/gateway-cluster-images/gateway-debugger:1.0.0 --share-processes -- /bin/bash
ubuntu@nextgen-gateway:~$ kubectl debug -it nextgen-gw-0 --image=us-docker.pkg.dev/opsramp-registry/gateway-cluster-images/gateway-debugger:1.0.0 --share-processes -- /bin/bash
Defaulting debug container name to debugger-t2cv2.
If you don't see a command prompt, try pressing enter.
 
root@nextgen-gw-0:/#

Examples 2: Debug using debugging utilities

root@nextgen-gw-0:/# ping pod1.opsramp.com
PING app.opsramp.com (140.239.76.75) 56(84) bytes of data.
64 bytes from app.vistarait.com (140.239.76.75): icmp_seq=1 ttl=52 time=264 ms
64 bytes from app.vistarait.com (140.239.76.75): icmp_seq=2 ttl=52 time=371 ms
64 bytes from app.vistarait.com (140.239.76.75): icmp_seq=3 ttl=52 time=291 ms
^C
--- app.opsramp.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 263.834/308.550/370.549/45.247 ms
root@nextgen-gw-0:/# nslookup pod1.opsramp.com
Server:     10.43.0.10
Address:    10.43.0.10#53
 
Non-authoritative answer:
pod1.opsramp.com    canonical name = app.opsramp.com.
Name:   app.opsramp.com
Address: 140.239.76.75
root@nextgen-gw-0:/# snmpwalk -v 2c -c public 192.168.17.90 .1
iso.0.8802.1.1.2.1.1.1.0 = INTEGER: 30
iso.0.8802.1.1.2.1.1.2.0 = INTEGER: 4
iso.0.8802.1.1.2.1.1.3.0 = INTEGER: 2
iso.0.8802.1.1.2.1.1.4.0 = INTEGER: 2
iso.0.8802.1.1.2.1.1.5.0 = INTEGER: 5
root@nextgen-gw-0:/# telnet localhost 11445
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
 
Welcome to Gateway CLI. Authorised users only. Term ID=767166274
Please type help to get list of commands supported.
Negotiated Terminal : xterm 173x43
gcli@gateway>