> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tsr/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/tsr/latest/installation/chart-config/sink.md).

# Traffic Stream Reporter Sink chart configuration

Traffic Stream Reporter (TSR) Sink is a stateless deployment that listens for IPFIX packets and stores relevant attributes of the packets in a MySQL or MariaDB database.

The following table lists the configurable parameters of the TSR Sink chart and their default values.

| Key | Type | Default | Description |
|---|---|---|---|
| additionalContainers | list | `[]` | Additional containers |
| additionalInitContainers | list | `[]` | Additional initContainers |
| additionalVolumeMounts | list | `[]` | Additional volume mounts used in main application container |
| additionalVolumes | list | `[]` | Additional volumes |
| affinity | object | `{}` | Assigns custom affinity rules to TSR Sink. [Documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) |
| annotations | object | `{}` | Kubernetes annotations for Pods [Documentation](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
| buffer.persist.size | int | `1000` | Configures the number of elements in the persist buffer. |
| buffer.read.size | int | `65535` | Configures the size of the application buffer for reading a datagram. |
| buffer.receive.size | int | `1000` | Configures the number of elements in the receive buffer. |
| buffer.socket.size | int | `0` | Configures the size of the kernel socket read buffer. The default value `0` means that the OS default value is used. |
| db.connections.maxidle | int | `10` | Configures the maximum number of idle database connections. |
| db.connections.maxlifetime | string | `"1h"` | Configures the maximum lifetime of the database connections. |
| db.connections.maxopen | int | `100` | Configures the maximum number of open database connections. |
| db.connections.reconnect.interval | string | `"1m"` | Configures the interval for reconnecting to the database. |
| db.connections.reconnect.maxretries | int | `5` | Configures the maximum number of retries for reconnecting to the database. |
| db.daysToPreCreateTables | int | `1` | Number of days in the future the tables are created for. |
| db.db | string | `nil` | Name of the database that should store the data |
| db.dsn | string | `nil` | DSN to connect to the database. If set, the `host`, `port`, `user`, `pass`, and `db`values are ignored. |
| db.host | string | `nil` | Host address of the SQL Database Server |
| db.pass | string | `nil` | Password for the SQL Database Server |
| db.persist.duration | string | `"5m"` | Configures the maximum time duration when data is inserted from the buffer to the database. |
| db.persist.retries | int | `5` | Defines the number of retries of insert if it fails. |
| db.port | int | `3306` | Port of the SQL Database Server |
| db.storageEngine | string | `"ARCHIVE"` | Storage engine used for tables in the database ( ARCHIVE | InnoDB ) |
| db.tablePrefix.egress | string | `"egress"` | TableName prefix for egress data (only when ipfix.type=dest) |
| db.tablePrefix.ingress | string | `"ingress"` | TableName prefix for ingress data (only when ipfix.type=dest) |
| db.tablePrefix.natEvent | string | `"natev"` | TableName prefix for natevent data (only when ipfix.type=default) |
| db.tablePrefix.traffic | string | `"traffic"` | TableName prefix for traffic data (only when ipfix.type=dest-aggregated) |
| db.upsert | bool | `true` | If set to `true`, performs an upsert (**db.storageEngine** needs to be `InnoDB`). Otherwise, appends only inserts (**db.storageEngine** should be `ARCHIVE`). |
| db.user | string | `nil` | User for the SQL Database Server |
| existingSecret | string | `""` | Name of an existing Kubernetes secret to use in the deployment |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | Image Pull Policy of TSR Sink's deployment. Can be one of "Always", "IfNotPresent", or "Never". |
| image.repository | string | `"registry.cennso.com/cennso-dev/tsr-sink"` | |
| image.tag | string | `"latest"` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | ImagePullSecrets to be added to TSR Sink's service account. Sample value: `[{name: "regcred"}]` |
| input | string | `"ipfix"` | Configures input type. The possible values are `ipfix` and `nats`. |
| ipfix.aggregated | bool | `true` | Specifies if Records are aggregated or not (default: true) |
| ipfix.biFlow | bool | `true` | Configures if Records have information for both direction (default: true) |
| ipfix.listenIP | string | `"0.0.0.0"` | Defines the IPv4/IPv6 address where to bind TSR Sink. |
| ipfix.port | int | `4739` | Defines the TCP/UDP port where to bind TSR Sink. |
| ipfix.templateTTL | int | `0` | (default: 0, lifetime management disabled, set to a timestring e.g. 5m, 5h -- if ipfix sender increments template ID and old should be dropped) |
| ipfix.transport | string | `"udp"` | Sets the transport to use. ( tpc | udp ) (default: udp) |
| ipfix.type | string | `"natEvent"` | Predefined type of IPFIX configuration ( natEvent | flowUsage ) |
| ipfix.ueNet | string | `nil` | Defines the list of UE networks. Example: ["10.0.0.0/8","FC00::/7"] |
| livenessProbe.failureThreshold | int | `1` | |
| livenessProbe.httpGet.path | string | `"/healthz"` | |
| livenessProbe.httpGet.port | string | `"metrics"` | |
| livenessProbe.periodSeconds | int | `10` | |
| loglevel | string | `"info"` | Configures the log level. The possible values are `error`, `info`, `debug`, and `trace`. |
| metrics.sqlStatementExecutionTimeBuckets | list | `[0,20,50,100,200,500,1000]` | Defines buckets for the **sql_statement_execution_time** metric. The values are provided in milliseconds. |
| minReadySeconds | int | `10` | Minimum number of seconds for which the pod should be ready without any of its container crashing, for it to be considered available |
| nameOverride | string | `""` | |
| nats.URL | string | `nil` | |
| nats.stream | string | `nil` | |
| nats.subjectPrefix | string | `"cennso.observability.ipfix"` | |
| output | string | `"sql"` | Configures output type. The possible values are `sql` and `nats`. |
| podSecurityContext | object | `{"fsGroup":2000}` | [Pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
| profiler | bool | `false` | If set to `true`, enables the profiler. |
| readinessProbe.failureThreshold | int | `30` | |
| readinessProbe.httpGet.path | string | `"/readyz"` | |
| readinessProbe.httpGet.port | string | `"metrics"` | |
| readinessProbe.periodSeconds | int | `10` | |
| replicaCount | int | `1` | Number of deployment replicas |
| resources.limits.cpu | string | `"1"` | |
| resources.limits.memory | string | `"1Gi"` | |
| resources.requests.cpu | string | `"0.5"` | |
| resources.requests.memory | string | `"768Mi"` | |
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
| securityContext.readOnlyRootFilesystem | bool | `true` | |
| securityContext.runAsNonRoot | bool | `true` | |
| securityContext.runAsUser | int | `1000` | |
| service.enabled | bool | `true` | Defines if Kubernetes service is created. |
| service.port | int | `4739` | Port on which TSR Sink's service exposes the nfacctd endpoint |
| service.type | string | `"ClusterIP"` | Service type used for publishing [Documentation](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) |
| terminationGracePeriodSeconds | int | `30` | Duration in seconds the pod needs to terminate gracefully. May be decreased in delete requests. The value must be a non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. |
| tolerations | list | `[]` | Kubernetes tolerations [Documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
| updateStrategy | object | `{"rollingUpdate":{"maxUnavailable":1},"type":"RollingUpdate"}` | Update strategy to replace existing TSR-Sink pods with new pods. [Documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#deploymentstrategy-v1-apps) |

## Use the existing secret

It is possible to use an already existing secret with TSR Sink instead of creating a new one using the provided Helm chart. To do so, provide the secret's name as the **existingSecret** value during installation. The existing secret must provide the following data:

```yaml
apiVersion: v1
kind: Secret
metadata:
  name: existing-secret
type: Opaque
stringData:
  MYSQL_USER: mysql_user
  MYSQL_PASS: mysql_password
```
