⎈ k8s knowledge compiler

Debug a StatefulSet [page]deterministic

tasks

This task shows you how to debug a StatefulSet.

##

* You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. * You should have a StatefulSet running that you want to investigate.

## Debugging a StatefulSet

In order to list all the pods which belong to a StatefulSet, which have a label `app.kubernetes.io/name=MyApp` set on them, you can use the following:

```shell kubectl get pods -l app.kubernetes.io/name=MyApp ```

If you find that any Pods listed are in `Unknown` or `Terminating` state for an extended period of time, refer to the [Deleting StatefulSet Pods](/docs/tasks/run-application/delete-stateful-set/) task for instructions on how to deal with them. You can debug individual Pods in a StatefulSet using the [Debugging Pods](/docs/tasks/debug/debug-application/debug-pods/) guide.

##

Learn more about [debugging an init-container](/docs/tasks/debug/debug-application/debug-init-containers/).

Sources

tasks/debug/debug-application/debug-statefulset.md · docDebug a StatefulSet

Related (4)

part_of {{% heading "prerequisites" %}}describes conf=1
part_of Debugging a StatefulSetdescribes conf=1
part_of {{% heading "whatsnext" %}}describes conf=1
api_for StatefulSetdocuments API object conf=1

← all Docs