# Health checks

> Ensure that the state of services within Kubernetes is healthy

Most services that you deploy within Kubernetes have their own health checks.

## Check the state of services

To check that the state of these services is healthy, run this command:

```sh
kubectl get pods --all-namespaces --field-selector=status.phase!=Running,status.phase!=Succeeded
```

If you're running multiple workloads within the same cluster, you might want to use a filter for the Kubernetes namespace that you have used to deploy the solution.

## Investigate pods that are in a non-healthy state

If you find pods that are in the **CrashLoopBack** state or the **Failed** state, investigate them as follows:

1. [Get a description of the resource](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_describe/).
2. [Query the pod logs](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_logs/).
