Skip to content

Commit 1b0c691

Browse files
authored
Merge pull request #21895 from mokua/patch-7
Update audit.md
2 parents 66fd7f7 + 9c24d96 commit 1b0c691

File tree

1 file changed

+34
-0
lines changed
  • content/en/docs/tasks/debug-application-cluster

1 file changed

+34
-0
lines changed

content/en/docs/tasks/debug-application-cluster/audit.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,40 @@ log audit backend using the following `kube-apiserver` flags:
134134
- `--audit-log-maxbackup` defines the maximum number of audit log files to retain
135135
- `--audit-log-maxsize` defines the maximum size in megabytes of the audit log file before it gets rotated
136136

137+
In case kube-apiserver is configured as a Pod,remember to mount the hostPath to the location of the policy file and log file. For example,
138+
`
139+
--audit-policy-file=/etc/kubernetes/audit-policy.yaml
140+
--audit-log-path=/var/log/audit.log
141+
`
142+
then mount the volumes:
143+
144+
145+
```
146+
volumeMounts:
147+
- mountPath: /etc/kubernetes/audit-policy.yaml
148+
name: audit
149+
readOnly: true
150+
- mountPath: /var/log/audit.log
151+
name: audit-log
152+
readOnly: false
153+
```
154+
finally the hostPath:
155+
156+
```
157+
- name: audit
158+
hostPath:
159+
path: /etc/kubernetes/audit-policy.yaml
160+
type: File
161+
162+
- name: audit-log
163+
hostPath:
164+
path: /var/log/audit.log
165+
type: FileOrCreate
166+
167+
```
168+
169+
170+
137171
### Webhook backend
138172

139173
Webhook backend sends audit events to a remote API, which is assumed to be the

0 commit comments

Comments
 (0)