Don't mount volume for auditLog when STDOUT is configured as path

Fixes #4202
This commit is contained in:
Christian Kampka 2018-07-16 22:53:58 +02:00
parent 498b5d72b6
commit 581eec3eca
1 changed files with 3 additions and 1 deletions

View File

@ -434,7 +434,9 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
}
auditLogPath := b.Cluster.Spec.KubeAPIServer.AuditLogPath
if auditLogPath != nil {
// Don't mount a volume if the mount path is set to '-' for stdout logging
// See https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#audit-backends
if auditLogPath != nil && *auditLogPath != "-" {
// Mount the directory of the path instead, as kube-apiserver rotates the log by renaming the file.
// Renaming is not possible when the file is mounted as the host path, and will return a
// 'Device or resource busy' error