.. SPDX-FileCopyrightText: 2024 - 2025 Univention GmbH
..
.. SPDX-License-Identifier: AGPL-3.0-only

.. _conf-scalability:

Scalability
===========

Nubus for Kubernetes consists of several components.
Some of the components allow you to scale them to your needs.
This section describes which components you can scale up in Nubus
and how you configure it.

Usually, the default replica count for each component is ``1``.

To change the scalability of the mentioned components,
you need to apply the following principle:

#. Update your :file:`custom_values.yaml` deployment file
   with the appropriate setting as described for each component later in this section.

#. Update your Nubus deployment through :command:`helm`
   by following the steps in :ref:`nubus-configuration-apply`.

.. seealso::

   :external+uv-nubus-kubernetes-architecture:ref:`overview-scalability` architecture in Nubus for Kubernetes
      in :cite:t:`uv-nubus-kubernetes-architecture`
      for the architectural description of the scalability
      of the functional components in Nubus for Kubernetes.

.. _conf-scalability-directory-manager:

Directory Manager
-----------------

The *Directory Manager* has the *UDM HTTP REST API* as scalable component.

To configure the scalability of the *UDM HTTP REST API*,
set :envvar:`nubusUdmRestApi.replicaCount`
to an integer value greater than the default value.

To apply configuration changes,
see instructions at :ref:`conf-scalability`.

.. important::

   Take the scalability considerations from
   :external+uv-nubus-kubernetes-architecture:ref:`scalability-directory-manager`
   in :cite:t:`uv-nubus-kubernetes-architecture`
   into account.

.. _conf-scalability-management-ui:

Management UI
-------------

The *Management UI* has the following scalable components.

*UMC-Server*
   To configure the scalability of the *UMC Server*,
   set :envvar:`nubusUmcServer.replicaCount`
   to an integer value greater than the default value.

   The *UMC Server* also has the setting :envvar:`nubusUmcServer.proxy.replicaCount`
   for the load balancer with session stickiness.
   Change the value to an integer value greater than the default value.

*UMC-Gateway*
   To configure the scalability of the *UMC Gateway*,
   set :envvar:`nubusUmcGateway.replicaCount`
   to an integer value greater than the default value.

In a high-traffic environment,
it's more important to scale up the *UMC Server* than the *UMC Gateway*.

To apply configuration changes,
see instructions at :ref:`conf-scalability`.

.. seealso::

   :external+uv-nubus-kubernetes-architecture:ref:`scalability-management-ui`
      in :cite:t:`uv-nubus-kubernetes-architecture`
      for architectural information about the scalability of the *Management UI*.

.. _conf-scalability-identity-provider:

Identity Provider
-----------------

The *Identity Provider* has the following scalable components.

*Keycloak*
   To configure the scalability of *Keycloak*
   set :envvar:`keycloak.replicaCount`
   to an integer value greater than the default value.

*Keycloak Proxy*
   If your Nubus for Kubernetes deployment has the *Keycloak Extensions* enabled,
   you can scale up the *Keycloak Proxy* in the *Keycloak Extensions*.
   Scale it up along with the scaling of the *Keycloak* Kubernetes pod.

   To configure the scalability of the *Keycloak Proxy*
   set :envvar:`nubusKeycloakExtensions.proxy.replicaCount`
   to an integer value greater than the default value.

To apply configuration changes,
see instructions at :ref:`conf-scalability`.

.. seealso::

   :ref:`conf-keycloak-extensions-activate`
      for information about how to enable *Keycloak Extensions*.

   :external+uv-nubus-kubernetes-architecture:ref:`scalability-identity-provider`
      in :cite:t:`uv-nubus-kubernetes-architecture`
      for architectural information about the scalability of the *Identity Provider*.

.. _conf-scalability-portal-service:

Portal Service
--------------

The *Portal Service* has the following scalable components:

*Portal Server*
   To configure the scalability of the *Portal Server*
   set :envvar:`nubusPortalServer.replicaCount`
   to an integer value greater than the default value.

*Portal Frontend*
   To configure the scalability of the *Portal Frontend*
   set :envvar:`nubusPortalFrontend.replicaCount`
   to an integer value greater than the default value.

In a high-traffic environment,
it's more important to scale up the *Portal Server* Kubernetes pod
than the *Portal Frontend* pod,
because the *Portal Server* actively handles requests from the *Portal Frontend*
and determines the portal content for each user.

To apply configuration changes,
see instructions at :ref:`conf-scalability`.

.. seealso::

   :external+uv-nubus-kubernetes-architecture:ref:`scalability-portal-service`
      in :cite:t:`uv-nubus-kubernetes-architecture`
      for architectural information about the scalability of the *Portal Service*.

.. _conf-scalability-directory-service:

Identity Store and Directory Service
------------------------------------

For the scalability of the *Identity Store and Directory Service*,
see :ref:`conf-ldap-scalability`.
