Skip to content

[Enhancement]: Retain Audit Logs for 7 days #613

@adambkaplan

Description

@adambkaplan

Design Document Link

PR: #

What would you like to be added:

The kube-apiserver has several parameters which allow audit log retention to be tuned. This is exposed by the following flags:

  • --audit-log-maxage defines the maximum number of days to retain old audit log files
  • --audit-log-maxbackup defines the maximum number of audit log files to retain
  • --audit-log-maxsize defines the maximum size in megabytes of the audit log file before it gets rotated

This enhancement sets the --audit-log-maxage setting to 7 days if microshift is configured with an audit log directory.

See https://kubernetes.io/docs/tasks/debug-application-cluster/audit/

Why is this needed:

With default settings, the audit logs on a minimal cluster can grow quite large. I deployed microshift on a very old laptop with what is by today's standards absurdly small storage (15GB). My cluster ultimately died because the kube-apiserver audit logs generated over the course of ~20 days exceeded 5GB, exhausting the space on the drive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions