Skip to content

Commit

Permalink
Set Default Audit Log Retention (#616)
Browse files Browse the repository at this point in the history
If an audit log directory is provided, set the default audit log
retention age to 7 days. When `--audit-log-maxage` is not specified,
kube-apiserver audit logs are retained indefinitely, taking up
signficant space on the host node.
  • Loading branch information
adambkaplan authored Mar 7, 2022
1 parent 2c2dd65 commit 27241be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/controllers/kube-apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (s *KubeAPIServer) configure(cfg *config.MicroshiftConfig) {
if cfg.AuditLogDir != "" {
args = append(args,
"--audit-log-path="+filepath.Join(cfg.AuditLogDir, "kube-apiserver-audit.log"))
args = append(args, "--audit-log-maxage=7")
}

// fake the kube-apiserver cobra command to parse args into serverOptions
Expand Down

0 comments on commit 27241be

Please sign in to comment.