1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/cnf-configuring-enhanced-log-filtering-for-linuxptp.adoc
2025-09-03 15:39:49 +00:00

108 lines
3.4 KiB
Plaintext

// Module included in the following assemblies:
//
// * networking/ptp/configuring-ptp.adoc
:_mod-docs-content-type: PROCEDURE
[id="cnf-configuring-enhanced-log-reduction-for-linuxptp_{context}"]
= Configuring enhanced PTP log reduction
Basic log reduction effectively filters out frequent logs. However, if you want a periodic summary of the filtered logs, use the enhanced log reduction feature.
.Prerequisites
* Install the OpenShift CLI (`oc`).
* Log in as a user with `cluster-admin` privileges.
* Install the PTP Operator.
.Procedure
. Edit the `PtpConfig` custom resource (CR):
+
[source,terminal]
----
$ oc edit PtpConfig -n openshift-ptp
----
. Add the `ptpSettings.logReduce` specification in the `spec.profile` section, and set the value to `enhanced`:
+
[source,yaml]
----
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: <ptp_config_name>
namespace: openshift-ptp
...
spec:
profile:
- name: "profile1"
...
ptpSettings:
logReduce: "enhanced"
----
. Optional: Configure the interval for summary logs and a threshold in nanoseconds for the master offset logs. For example, to set the interval to 60 seconds and the threshold to 100 nanoseconds, add the `ptpSettings.logReduce` specification in the `spec.profile` section and set the value to `enhanced 60s 100`.
+
[source,yaml]
----
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: <ptp_config_name>
namespace: openshift-ptp
spec:
profile:
- name: "profile1"
ptpSettings:
logReduce: "enhanced 60s 100" <1>
----
+
<1> By default, the `linuxptp-daemon` is configured to generate summary logs every 30 seconds if no value is specified. In the example configuration, the daemon generates summary logs every 60 seconds and a threshold of 100 nanoseconds for the master offset logs is set. This means the daemon only produces summary logs at the specified interval. However, if your clock's offset from the master exceeds plus or minus 100 nanoseconds, that specific log entry is recorded.
. Optional: To set the interval without a master offset threshold, configure the `logReduce` field to `enhanced 60s` in the YAML.
+
[source,yaml]
----
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: <ptp_config_name>
namespace: openshift-ptp
spec:
profile:
- name: "profile1"
ptpSettings:
logReduce: "enhanced 60s"
----
. Save and exit to apply the changes to the `PtpConfig` CR.
.Verification
. Get the name of the `linuxptp-daemon` pod and the corresponding node where the `PtpConfig` CR is applied by running the following command
+
[source,terminal]
----
$ oc get pods -n openshift-ptp -o wide
----
+
.Example output
[source,terminal]
----
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-gmv2n 3/3 Running 0 1d17h 10.1.196.24 compute-0.example.com
linuxptp-daemon-lgm55 3/3 Running 0 1d17h 10.1.196.25 compute-1.example.com
ptp-operator-3r4dcvf7f4-zndk7 1/1 Running 0 1d7h 10.129.0.61 control-plane-1.example.com
----
. Verify that master offset messages are excluded from the logs by running the following command:
+
[source,terminal]
----
$ oc -n openshift-ptp logs <linux_daemon_container> -c linuxptp-daemon-container | grep "master offset" <1>
----
<1> <linux_daemon_container> is the name of the `linuxptp-daemon` pod, for example, `linuxptp-daemon-gmv2n`.