Skip to content

Commit 2b69575

Browse files
authored
Merge pull request #15053 from nextcloud/feat/noid/exapp-container-log-rotation
docs(exapps_management): document ExApp container log rotation
2 parents c2bc696 + 4811065 commit 2b69575

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

admin_manual/exapps_management/DeployConfigurations.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,74 @@ Docker Socket Proxy security
568568
AIO Docker Socket Proxy has strictly limited access to the Docker APIs described in `HAProxy configuration <https://github.com/nextcloud/all-in-one/blob/main/Containers/docker-socket-proxy/haproxy.cfg>`_.
569569

570570

571+
.. _exapp-container-log-rotation:
572+
573+
Container log rotation
574+
----------------------
575+
576+
AppAPI deploys each ExApp as a container but does not set a logging configuration on it, so each ExApp container
577+
uses the logging settings of the deploy daemon that runs it. If those logs have no size limit they are never
578+
rotated and can grow until they fill the host disk. Configure rotation on the daemon, where it applies to every
579+
container the daemon runs.
580+
581+
Docker
582+
^^^^^^
583+
584+
Docker's default ``json-file`` driver sets no size limit. Add the following to the Docker daemon configuration file
585+
(:file:`/etc/docker/daemon.json` on most Linux hosts) and restart the daemon:
586+
587+
.. code-block:: json
588+
589+
{
590+
"log-driver": "json-file",
591+
"log-opts": {
592+
"max-size": "10m",
593+
"max-file": "3"
594+
}
595+
}
596+
597+
.. code-block:: bash
598+
599+
sudo systemctl restart docker
600+
601+
Each container then keeps at most ``max-file`` log files of ``max-size`` each (here three files of 10 MB, so up to
602+
30 MB per container). Adjust the values to suit your hosts.
603+
604+
.. note::
605+
606+
A container keeps the logging configuration it was created with, and disabling and enabling an ExApp only stops
607+
and starts the existing container. Remove and install the affected ExApps again (or update them) so their
608+
containers are recreated with the new settings.
609+
610+
.. important::
611+
612+
Keep the ``json-file`` or ``journald`` driver: AppAPI can only download container logs for these two drivers, so a
613+
different driver disables log downloads for ExApp containers.
614+
615+
If you deliberately use a different driver (``syslog``, ``fluentd``, and so on) to forward logs elsewhere, keep your
616+
existing setup: rotation is then handled by that driver and the steps above do not apply.
617+
618+
Podman
619+
^^^^^^
620+
621+
When the deploy daemon is Podman, set a global default in :file:`/etc/containers/containers.conf` (or the per-user
622+
file) and re-deploy the affected ExApps:
623+
624+
.. code-block:: toml
625+
626+
[containers]
627+
log_driver = "json-file"
628+
log_size_max = 10485760
629+
630+
Kubernetes
631+
^^^^^^^^^^
632+
633+
For the Kubernetes deploy daemon, container log rotation is handled by the kubelet, not by AppAPI. Set
634+
``containerLogMaxSize`` and ``containerLogMaxFiles`` in the kubelet configuration on each node and restart the kubelet
635+
for the change to take effect (it loads its configuration only at startup); see the
636+
`Kubernetes logging architecture <https://kubernetes.io/docs/concepts/cluster-administration/logging/>`_ documentation.
637+
638+
571639
NC to ExApp Communication
572640
-------------------------
573641

0 commit comments

Comments
 (0)