> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/tposs/latest/use-cases/availability-cases/tposs-ha.md).

# High availability

For high availability (HA) in a production deployment, it is recommended to set up at least three TPOSS replicas to handle all incoming
requests and maintain session status during the upgrade procedure. You can configure TPOSS replicas using this configuration option:

```yaml
replicaCount: 3
```

The additional configuration options to maintain TPOSS for high availability are:

```yaml
podIP:
  enabled: true

probes:
  enabled: true
  liveness:
    initialDelaySeconds: 15
    timeoutSeconds: 3
    periodSeconds: 10
    failureThreshold: 5
  readiness:
    initialDelaySeconds: 20
    timeoutSeconds: 3
    periodSeconds: 10
    failureThreshold: 5

terminationGracePeriodSeconds: 30
```

- **podIP** enables special naming for TPOSS nodes so that each TPOSS node knows how to do service discovery for other TPOSS nodes and all of
the deployed TPOSS instances know how to build a cluster.
- **probes** enables liveness and readiness probes, which can be useful for graceful termination during TPOSS cluster upgrade. For more information about probes, see the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes).
- **terminationGracePeriodSeconds** specifies the number of seconds for a termination grace period. As a TPOSS node receives the `SIGTERM` signal, the TPOSS node is marked as `not ready` and it waits the specified period of time to finish handling of all requests.

> [!NOTE]
> The value must be at least cluster's [DNS TTL](https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/) + 10 seconds, and no less than 10 seconds in general.

After all TPOSS instances are up and running, run the `Tposs.Utils.get_nodes` command to make sure that each TPOSS instance is connected to the cluster. This command returns the list of all known nodes:

```elixir
Tposs.Utils.get_nodes()
```

In the case of three replicas, the output looks like this:

```
[:"tposs_tisp@10.42.106.11", :"tposs_tisp@10.42.175.137",
 :"tposs_tisp@10.42.6.130"]
```

For more information on how to execute commands within TPOSS and get into TPOSS remote console, read the [Troubleshooting guide](https://docs.cennso.com/components/tposs/latest/troubleshooting/troubleshooting.md).
The upgrade procedure is executed using the `helm upgrade` command. For more information, see the [Installation guide](https://docs.cennso.com/components/tposs/latest/installation/installation.md).

> [!NOTE]
> It is worth upgrading the TPOSS cluster only when there is a minimal number of active users.
