# Restarting Agents

Connectware agents run as containerized workloads, which are managed by your chosen deployment method (Docker or Kubernetes). Agent restarts are performed outside of Connectware using standard platform tools.

Restarting an agent can be necessary if the agent becomes unresponsive, loses connectivity, or needs to reload its configuration.

{% tabs %}
{% tab title="Kubernetes" %}

### Restarting Agents on Kubernetes

#### Restarting a Single Agent

Use this if you want to restart a single agent.

{% code lineNumbers="true" %}

```sh
kubectl rollout restart statefulset ${STATEFULSET_NAME} -n ${NAMESPACE}
```

{% endcode %}

Replace `${STATEFULSET_NAME}` with your agent statefulset’s name and `${NAMESPACE}` with the correct namespace.

#### Restarting All Agents from a `connectware-agent` Installation

Use this if you want to restart all agents managed by one `connectware-agent` installation.

{% code lineNumbers="true" %}

```sh
kubectl rollout restart statefulset -l app.kubernetes.io/instance=${INSTALLATION_NAME} -n ${NAMESPACE}
```

{% endcode %}

Replace `${INSTALLATION_NAME}` and `${NAMESPACE}` as needed.

**Result**

After restarting, your agent will automatically reconnect to Connectware once the pod is running again. Restarting an agent does not affect other agents or the Connectware core system.

**Troubleshooting**

If your agent does not reconnect after a restart, check the pod/container logs for errors and ensure network connectivity to Connectware.
{% endtab %}

{% tab title="Docker" %}

### Restarting Agents with Docker

If the agent is running as a Docker container, you can restart it with:

{% code lineNumbers="true" %}

```sh
docker restart ${CONTAINER_NAME}
```

{% endcode %}

Replace `${CONTAINER_NAME}` with the name of the agent container you want to restart.

**Result**

After restarting, the agent will automatically reconnect to Connectware once the container or pod is running again.
{% endtab %}
{% endtabs %}

## Additional Resources

For platform-specific details, see the official documentation:

* Docker: <https://docs.docker.com/>
* Kubernetes: <https://kubernetes.io/docs/>
