Skip to content

Prerequisites

Docker image registry

You must have valid credentials to access the Netaxis public Docker registry in order to download the SRE container images.

sh
[root@k8s ~]# kubectl create secret docker-registry netaxis-registry-secret \
  --docker-server=https://docker-public.bxl.netaxis.be \
  --docker-username=<USERNAME> \
  --docker-password=<PASSWORD>

Verify that the secret has been successfully created:

sh
[root@k8s ~]# kubectl describe secret netaxis-registry-secret
Name:         netaxis-registry-secret
Namespace:    default
Labels:       <none>
Annotations:  <none>

Type:  kubernetes.io/dockerconfigjson

Data
====
.dockerconfigjson:  138 bytes

Attach the secret to the default ServiceAccount:

sh
[root@k8s ~]# kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "netaxis-registry-secret"}]}'
serviceaccount/default patched

Helm

Helm is required to install SRE and the associated databases.

Refer to the official Helm documentation for detailed installation instructions appropriate for your Kubernetes cluster.

Install Operator for Postgres

Add the Helm repository for PostgreSQL:

sh
[root@k8s ~]# helm repo add cnpg https://cloudnative-pg.github.io/charts

Verify that the repository has been added:

sh
[root@k8s ~]# helm repo list
NAME   	URL
cnpg   	https://cloudnative-pg.github.io/charts

Install the PostgreSQL operator:

sh
[root@k8s ~]# helm upgrade --install cnpg cnpg/cloudnative-pg --namespace cnpg-system --create-namespace

Install Operator for MongoDB (optional)

A MongoDB cluster is required for the following features:

  • call admission control
  • global caching nodes
  • registrar

If you do not intend to use these features, you may skip this section and the subsequent Create MongoDB cluster (optional).

Add the Helm repository for MongoDB:

sh
[root@k8s ~]# helm repo add mongodb https://mongodb.github.io/helm-charts

Verify that the repository has been added:

sh
[root@k8s ~]# helm repo list
NAME   	URL
mongodb	https://mongodb.github.io/helm-charts
...

Install the MongoDB operator:

[root@k8s ~]# kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-kubernetes/1.2.0/public/crds.yaml
[root@k8s ~]# helm upgrade --install mongodb-kubernetes-operator mongodb/mongodb-kubernetes --namespace mongodb --create-namespace

Installation of SRE

Create Postgres cluster

Save the following manifest as sre-pg-cluster.yaml and adjust the parameters as required:

  • stringData.password: the password for the sre user in PostgreSQL.
  • spec.instances: the number of PostgreSQL instances to deploy. Read-heavy workloads may benefit from increasing this value.
  • storage.size: the storage size, depending on your data retention and capacity requirements.
yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: kamailio-tables
data:
  kamailio-tables.sql: |
    CREATE TABLE dispatcher (
      id SERIAL PRIMARY KEY NOT NULL,
      destination VARCHAR(192) DEFAULT '' NOT NULL,
      refresh_time TIMESTAMP,
      CONSTRAINT dispatcher_table_destination_idx UNIQUE (destination)
    );
    ALTER TABLE dispatcher OWNER TO sre;
---
apiVersion: v1
kind: Secret
metadata:
  name: sre-user-secret
type: kubernetes.io/basic-auth
stringData:
  username: sre
  password: supersecretpw
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: sre-pg-cluster
  labels:
    release: prometheus
spec:
  instances: 3
  monitoring:
    enablePodMonitor: false
  bootstrap:
    initdb:
      database: sre
      owner: sre
      secret:
        name: sre-user-secret
      postInitApplicationSQLRefs:
        configMapRefs:
          - name: kamailio-tables
            key: kamailio-tables.sql
  managed:
    roles:
    - name: sre
      ensure: present
      login: true
      createdb: true
      inRoles:
        - pg_monitor
  storage:
    size: 1Gi

Apply the manifest:

sh
kubectl apply -f sre-pg-cluster.yaml

If you intend to monitor the PostgreSQL cluster with Prometheus/Grafana, save the following manifest as sre-pg-prometheus.yaml:

yaml
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: sre-pg-podmonitor
  labels:
    release: prometheus
spec:
  selector:
    matchLabels:
      "cnpg.io/cluster": sre-pg-cluster
  podMetricsEndpoints:
    - port: metrics
      path: /metrics

Apply it using:

sh
kubectl apply -f sre-pg-prometheus.yaml

Create MongoDB cluster (optional)

Save the following manifest as sre-mongo-cluster.yaml and adjust the configuration as required:

  • stringData.password: the password for MongoDB and Prometheus metrics access.
  • spec.members: the number of MongoDB instances to deploy. Read-heavy workloads may benefit from increasing this value.
yaml
apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
  name: sre-mongodb
spec:
  members: 3
  type: ReplicaSet
  version: "6.0.5"
  security:
    authentication:
      modes: ["SCRAM"]
  prometheus:
    # Metrics endpoint HTTP Basic Auth username
    username: prometheus-username

    # Metrics endpoint HTTP Basic Auth password
    passwordSecretRef:
      name: metrics-endpoint-password
  users:
    - name: sre-user
      db: admin
      passwordSecretRef: # a reference to the secret that will be used to generate the user's password
        name: sre-user-password
      roles:
        - name: clusterAdmin
          db: admin
        - name: userAdminAnyDatabase
          db: admin
      scramCredentialsSecretName: sre-scram
  additionalMongodConfig:
    storage.wiredTiger.engineConfig.journalCompressor: zlib

# the user credentials will be generated from this secret
# once the credentials are generated, this secret is no longer required
---
apiVersion: v1
kind: Secret
metadata:
  name: sre-user-password
type: Opaque
stringData:
  password: your-password-here
---
apiVersion: v1
kind: Secret
metadata:
  name: metrics-endpoint-password
type: Opaque
stringData:
  password: 'Not-So-Secure!'
  username: prometheus-username

Apply the manifest:

sh
kubectl apply -f sre-mongo-cluster.yaml

If you plan to monitor the MongoDB cluster with Prometheus/Grafana, save the following manifest as sre-mongo-prometheus.yaml:

yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  annotations:

  # This needs to match `spec.ServiceMonitorSelector.matchLabels` from your
  # `prometheuses.monitoring.coreos.com` resouce.
  labels:
    release: prometheus

  name: mongodb-sm
spec:
  endpoints:

  # Configuring a Prometheus Endpoint with basic Auth.
  # `prom-secret` is a Secret containing a `username` and `password` entries.
  - basicAuth:
      password:
        key: password
        name: metrics-endpoint-password
      username:
        key: username
        name: metrics-endpoint-password

    # This port matches what we created in our MongoDB Service.
    port: prometheus

    # If using HTTPS enabled endpoint, change scheme to https
    scheme: http

    # Configure different TLS related settings. For more information, see:
    # https://github.com/prometheus-operator/prometheus-operator/blob/main/pkg/apis/monitoring/v1/types.go#L909
    # tlsConfig:
    #    insecureSkipVerify: true

  # What namespace to watch
  namespaceSelector:
    matchNames:
    - mongodb

  # Service labels to match
  selector:
    matchLabels:
      app: sre-mongodb-svc

Apply it using:

sh
kubectl apply -f sre-mongo-prometheus.yaml

Install the SRE Helm chart

Configuration options

The table below lists the configuration options available for SRE deployment:

KeySubkeyDescriptionDefault ValueRequired
imageDocker image used for the SRE deploymentdocker-public.bxl.netaxis.be/repo/sre/sre-allinone:latestNo
lb-imageDocker image for the SIP load balancer componentdocker-public.bxl.netaxis.be/repo/sre/siplb:6.0.3No
timezoneSets the system timezoneYes
call-processors-countNumber of call-processing instances to spawn0No
http-processors-countNumber of HTTP-processing instances to spawn0No
enum-processors-countNumber of ENUM processors to spawn0No
media-processors-countNumber of media-processing instances to run0No
storage-classKubernetes storage class for persistent volumes. Default value not recommended for production.local-pathNo
cdr-storage-sizeStorage size for cdrs in Gb5No
ingresshostFQDN used to expose HTTP interfaces (GUI/REST/HTTP)Yes
sipportsip port to be exposed on sip load balancer5060No
dbhostHostname or IP address of R/W postgres instanceYes
dbro_hostHostname or IP address of R/O postgres instanceYes
dbpasswordPassword for the database connectionYes
mongohostMongoDB hostNo
mongouserUsername used to authenticate with MongoDBRequired if host is set
mongopasswordPassword for MongoDB authenticationRequired if host is set
mongoreplica_setMongoDB replica set name for high availabilitysre-mongodbNo

Create a sre-values.yaml file containing all parameters required for your deployment.

Copy the SRE Helm package and install it using:

sh
[root@k8s ~]# helm install sre-prod sre-4.2.0.tgz -f sre-values.yaml

Verify SRE is installed using:

sh
[root@k8s ~]# helm ls
NAME 	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART    	APP VERSION
sre-prod	default  	1       	2025-11-07 14:08:34.187070322 +0100 CET	deployed	sre-4.2.0

Upgrades

To upgrade SRE, update the Docker image version tags in sre-values.yaml and execute:

sh
[root@k8s ~]# helm upgrade sre-prod -f sre-values.yaml

Uninstall of SRE

To remove the SRE deployment:

sh
[root@k8s ~]# helm uninstall sre-prod
release "sre-prod" uninstalled