Comment 2 for bug 2009784

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/c/starlingx/ansible-playbooks/+/876895
Committed: https://opendev.org/starlingx/ansible-playbooks/commit/23561c8fe31ba3cb99612f418c9cbc2da2a7ca7f
Submitter: "Zuul (22348)"
Branch: master

commit 23561c8fe31ba3cb99612f418c9cbc2da2a7ca7f
Author: Leonardo Fagundes Luz Serrano <email address hidden>
Date: Wed Mar 8 18:18:19 2023 -0300

    Backup flux pod logs

    Kubernetes only keeps logs for the current instance and the previous
    instance of a running pod. At this time, a kubectl configuration to
    customize this behavior has not been found.

    To prevent losing flux logs everytime flux is restarted, the command
    and arguments passed to the containers have been adapted to forward
    stdout and stderr to a log file in a volume hosted at /var/log/flux

    The container commands are the adapted from the Entrypoints in their
    Dockerfiles [1] and [2]. Note helm-controller uses tini to create
    its process while source-controller doesn't.

    [1] https://github.com/fluxcd/source-controller/blob/v0.32.1/Dockerfile
    [2] https://github.com/fluxcd/helm-controller/blob/v0.27.0/Dockerfile

    Test Plan:
    pass: Run bootstrap. Confirm logs are being saved to /var/log/flux
    pass: Run unlock to restart the node. New flux logs still saved to
          same files, despite kubectl rotating log files at /var/log/pods
    pass: Restart node. New flux logs preserve old entries, despite kubectl
          erasing old log files at /var/log/pods
    pass: Restart flux. flux log files preserved and logging still normal
    pass: logrotate rotating /var/log/flux logs

    Depends-On: https://review.opendev.org/c/starlingx/config-files/+/877669

    Closes-Bug: 2009784

    Signed-off-by: Leonardo Fagundes Luz Serrano <email address hidden>
    Change-Id: I2863e7e76a432412cb45706c9f49b2b43a888877