> 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/installation/requirements.md).

# Requirements

This document lists requirements for TPOSS and the database server that your environment must meet before proceeding with the installation.

## TPOSS requirements

- A Kubernetes or a [Cennso Core Cluster](https://docs.cennso.com/cennso/cennso/main/concepts/core-cluster.md) to deploy the TPOSS workloads and access to it. The minimal version of Kubernetes is `1.29`.
- [Helm](https://helm.sh/) with the minimal version `3.8`.
- A MySQL server or a cluster must be deployed before TPOSS. The database must be reachable by the TPOSS pods, and have a schema and users created. For the supported versions and the setup steps, see the [Database server requirements](#database-server-compatibility-and-requirements) section.
- The namespace where TPOSS is deployed must not enforce the `restricted` [Pod Security Standard](https://kubernetes.io/docs/concepts/security/pod-security-standards/). The TPOSS pods do not set the `seccompProfile` and the `allowPrivilegeEscalation` options, and do not drop Linux capabilities, so the `restricted` policy rejects them. The `baseline` policy is enough. If the **initScript.enabled** configuration option is set to `true`, the namespace needs the `privileged` policy, because the init script container runs as `root` and adds the `NET_ADMIN` capability.
- A Kubernetes [Secret](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) with the credentials to pull the [TPOSS container images](https://docs.cennso.com/components/tposs/latest.md#additional-containers-and-charts) must exist in the namespace where TPOSS is deployed. Set the **imagePullSecrets** configuration option to the name of this Secret. Cennso clusters usually already have such a Secret for the registry.

In addition, the following dependencies and components must be deployed and be up and running before the TPOSS deployment, if you enable the corresponding feature:

- To use the NATS-based [global lock](https://docs.cennso.com/components/tposs/latest/configuration/session.md#session-handler-locking) for the sessions, a [NATS](https://nats.io/) server with [JetStream](https://docs.nats.io/concepts/jetstream) enabled is required. For more information on how to deploy a NATS server, see the [NATS configuration](https://docs.cennso.com/components/tposs/latest/technical-reference/nats.md) document.
- To monitor the TPOSS deployments, [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator) is required, and at least one of these options must be enabled:
  - **servicemonitor.enabled**
  - **prometheus_recording_rules.enabled**
  - **nats.promExporter.enabled**
- To expose TPOSS through an [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/), an ingress controller matching **tposs_ingress.ingressClassName** is required, and this option must be set.
- To assign a static IP address to the TPOSS pods, [Calico IPAM](https://docs.tigera.io/calico/latest/about/) with an IP pool that contains this address is required, and these options must be set:
  - **ipAddr.enabled** set to `true`
  - **ipAddr.ip** set to the static IP address
- To serve the [S6a HSS interface](https://docs.cennso.com/components/tposs/latest/configuration/hss.md) over SCTP, the `sctp` Linux kernel module is required on every node that runs the HSS server.
- To let the external billing systems fetch the CDRs over [SFTP](https://docs.cennso.com/components/tposs/latest/configuration/charging.md#sftp-settings) from outside the cluster, a [LoadBalancer](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) provider is required, and these options must be set:
  - **sftp.enabled** set to `true`
  - **sftp.service.type** set to `LoadBalancer`, which is the default

## Database server compatibility and requirements

TPOSS works with the following versions of these database servers:

- MariaDB [10.3](https://mariadb.org/download/?prod=mariadb&rel=10.3.0&old=1&t=mariadb) to [10.5](https://mariadb.com/docs/release-notes/community-server/old-releases/10.5/what-is-mariadb-105)
- MySQL [8.0](https://dev.mysql.com/doc/relnotes/mysql/8.0/en/)

> [!NOTE]
> MySQL 8.4 is supported in the context of compatibility, but it was not tested under load and in a production environment. If you are going to use it, make sure to enable the [`mysql_native_password`](https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html) authentication plugin.

> [!IMPORTANT]
> If you need support for MySQL clustering, it is highly recommended to use the [Cennso Database extension](https://docs.cennso.com/cennso/cennso-db/main.md).
>
> Although it was not tested under load and in a production environment, TPOSS should be compatible to run with the MariaDB Galera cluster and MySQL NDB cluster, and it does not have any specific limitations according to the [MySQL NDB](https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-limitations-syntax.html) and [MariaDB Galera cluster](https://mariadb.com/docs/galera-cluster/galera-management/mariadb-galera-cluster-known-limitations) documentation.

To operate with MySQL, TPOSS must have a database created and a user with permissions on that database.

Using the following SQL query, you can create a UTF-8 encoded database named `tposs`:

```sql
CREATE DATABASE IF NOT EXISTS tposs CHARACTER SET UTF8 COLLATE utf8_bin;
```

The actual database name can be different and depends on what you configure in the **database.name** configuration option. For more information, see the [Database settings](https://docs.cennso.com/components/tposs/latest/configuration/db.md) document.

To create a database user and grant the needed permissions, you can use the following SQL queries:

```SQL
CREATE USER IF NOT EXISTS 'tposs'@'%' IDENTIFIED WITH mysql_native_password BY 'tposs';
GRANT ALL PRIVILEGES ON tposs.* TO 'tposs'@'%';
GRANT REPLICATION CLIENT ON *.* TO 'tposs'@'%';
GRANT REPLICATION SLAVE ON *.* TO 'tposs'@'%';
GRANT REPLICATION_SLAVE_ADMIN ON *.* TO 'tposs'@'%';
GRANT GROUP_REPLICATION_STREAM ON *.* TO 'tposs'@'%';
GRANT PROCESS ON *.* TO 'tposs'@'%';
GRANT RELOAD ON *.* TO 'tposs'@'%';
GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO 'tposs'@'%';
GRANT BINLOG_ADMIN ON *.* TO 'tposs'@'%';
GRANT USAGE ON *.* TO 'tposs'@'%';
FLUSH PRIVILEGES;
```

The queries above create the user named `tposs` with password `tposs`. You can use any user name and password, but they must reflect the TPOSS database client configuration options **database.user** and **database.password**. For more information, see the [Database settings](https://docs.cennso.com/components/tposs/latest/configuration/db.md) document.

### Optional requirements

#### Tables partitioning

If TPOSS is configured to have the [CDR table partitioned](https://docs.cennso.com/components/tposs/latest/configuration/charging.md#charging-data-records-configuration), enable the [MySQL event scheduler](https://dev.mysql.com/doc/refman/8.0/en/event-scheduler.html):

```sql
SET GLOBAL event_scheduler = ON;
```

If there is more than one MySQL instance used in the deployment, disable the events on the secondary MySQL instances:

```sql
ALTER EVENT drop_partitions DISABLE ON SLAVE;
ALTER EVENT reorganize_partitions DISABLE ON SLAVE;
```

#### Connection pooling

The size of a connection pool configured in the database must match the expectation of the applications. For example, a database connected to two TPOSS instances with a configured pool size of 100 must be able to handle at least 200 connections. You can check the possible number of connections using the `max_connections` MySQL variable:

```sql
SHOW VARIABLES LIKE "max_connections";
```

It is worth to set `max_connections` to a value higher than the pool size of all TPOSS instances to have a separate access through the standard MySQL client to the database.

> [!NOTE]
> To execute each query, TPOSS uses [prepared statements](https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html). The default limit of the maximum number of the prepared statements might not be suitable for production. It is worth to set `max_prepared_stmt_count` to `50000`.
