Skip to content

Commit f6ba97e

Browse files
authored
Merge pull request #96991 from openshift-cherrypick-robot/cherry-pick-96800-to-enterprise-4.19
[enterprise-4.19] OBSDOCS-2214: Change module type for metrics server audit logs module
2 parents c590354 + 7737e5b commit f6ba97e

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

modules/monitoring-configuring-audit-logs-for-metrics-server.adoc

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,37 @@
22
//
33
// * observability/monitoring/configuring-the-monitoring-stack.adoc
44

5-
:_mod-docs-content-type: CONCEPT
5+
:_mod-docs-content-type: PROCEDURE
66
[id="configuring-audit-logs-for-metrics-server_{context}"]
77
= Configuring audit logs for Metrics Server
88

99
You can configure audit logs for Metrics Server to help you troubleshoot issues with the server.
1010
Audit logs record the sequence of actions in a cluster. It can record user, application, or control plane activities.
1111

12-
You can set audit log rules, which determine what events are recorded and what data they should include. This can be achieved with the following audit profiles:
12+
You can configure audit log rules to record specific events and a subset of associated data. The following audit profiles define configuration rules:
1313

14-
* *Metadata (default)*: This profile enables the logging of event metadata including user, timestamps, resource, and verb. It does not record request and response bodies.
15-
* *Request*: This enables the logging of event metadata and request body, but it does not record response body. This configuration does not apply for non-resource requests.
16-
* *RequestResponse*: This enables the logging of event metadata, and request and response bodies. This configuration does not apply for non-resource requests.
17-
* *None*: None of the previously described events are recorded.
14+
* `Metadata` (default): This profile logs event metadata including user, timestamps, resource, and verb. It does not record request and response bodies.
15+
* `Request`: This profile logs event metadata and request body, but it does not record response body. This configuration does not apply to non-resource requests.
16+
* `RequestResponse`: This profile logs event metadata, and request and response bodies. This configuration does not apply to non-resource requests.
17+
* `None`: None of the previously described events are recorded.
1818
19-
You can configure the audit profiles by modifying the `cluster-monitoring-config` config map.
20-
The following example sets the profile to `Request`, allowing the logging of event metadata and request body for Metrics Server:
19+
.Prerequisites
2120

21+
* You have access to the cluster as a user with the `cluster-admin` cluster role.
22+
* You have created the `cluster-monitoring-config` `ConfigMap` object.
23+
* You have installed the {oc-first}.
24+
25+
.Procedure
26+
27+
. Edit the `cluster-monitoring-config` config map in the `openshift-monitoring` project:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc -n openshift-monitoring edit configmap cluster-monitoring-config
32+
----
33+
34+
. Add audit log configuration for Metrics Server under `data/config.yaml`:
35+
+
2236
[source,yaml]
2337
----
2438
apiVersion: v1
@@ -30,5 +44,21 @@ data:
3044
config.yaml: |
3145
metricsServer:
3246
audit:
33-
profile: Request
47+
profile: <audit_log_profile> # <1>
48+
----
49+
<1> Specify the audit profile for Metrics Server.
50+
51+
. Save the file to apply the changes. The pods affected by the new configuration are automatically redeployed.
52+
53+
. Verify that the audit profile is applied:
54+
+
55+
[source,terminal]
56+
----
57+
$ oc -n openshift-monitoring get deploy metrics-server -o yaml | grep -- '--audit-policy-file=*'
58+
----
59+
+
60+
.Example output
61+
[source,terminal]
62+
----
63+
- --audit-policy-file=/etc/audit/request-profile.yaml
3464
----

0 commit comments

Comments
 (0)