debug command ΒΆ

The debug command allows you to troubleshoot workloads running on the Nais platform.This command creates a debug pod within the same namespace as the target workload. There are two options for debugging a workload: you can either create a container within the same pod as the workload or create a separate pod in the same namespace as the workload, both options providing a shared namespace.

debug ΒΆ

Creates a debug pod in the same namespace as the target workload.

nais debug app creates a debug container in the "live" pod, meaning it’s not a copy of the original pod. If you exit this command, you cannot reconnect or attach again, because the debug container is terminated. To debug, simply run nais debug app again, this will create a new debug container in the same pod. See tidy to clean up the pod you just debugged.

nais debug app --copy app creates a copy of the original pod in the same namespace. This is useful if you want to debug the pod without affecting the live pod, useful for debugging production workloads. If you exit this command, you can reconnect/attach again by running nais debug app --copy app again. See tidy to clean up the pod you just debugged.

bash
ArgumentRequiredDescription
appYesName of the workload to debug.
FlagRequiredShortDefaultDescription
namespaceNo-ncurrentNamespace of the workload.
contextNo-ccurrentContext of the workload.
copyNo-cpin current live podCopy the workload's pod to a separate pod with container.
by-podNo-pfirst podSpecify the pod to debug.

tidy ΒΆ

Delete the debug pod. This command will delete the debug pod created by the nais debug command.

bash
ArgumentRequiredDescription
appYesName of the workload to delete.
FlagRequiredShortDefaultDescription
namespaceNo-ncurrentNamespace of the pod.
contextNo-ccurrentContext of the pod.
copyNo-cplive podDelete the copied pod.

debug image and tools ΒΆ

The image used for debugging is documented in debug repository.