This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 9. Configuring PTP hardware
Precision Time Protocol (PTP) hardware is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.
9.1. About PTP hardware Copier lienLien copié sur presse-papiers!
OpenShift Container Platform includes the capability to use Precision Time Protocol (PTP)hardware on your nodes. You can configure linuxptp services on nodes in your cluster that have PTP-capable hardware.
The PTP Operator works with PTP-capable devices on clusters provisioned only on bare metal infrastructure.
You can use the OpenShift Container Platform console to install PTP by deploying the PTP Operator. The PTP Operator creates and manages the linuxptp services. The Operator provides the following features:
- Discovery of the PTP-capable devices in a cluster.
- Management of the configuration of linuxptp services.
9.2. Automated discovery of PTP network devices Copier lienLien copié sur presse-papiers!
The PTP Operator adds the NodePtpDevice.ptp.openshift.io custom resource definition (CRD) to OpenShift Container Platform. The PTP Operator will search your cluster for PTP capable network devices on each node. The Operator creates and updates a NodePtpDevice custom resource (CR) object for each node that provides a compatible PTP device.
One CR is created for each node, and shares the same name as the node. The .status.devices list provides information about the PTP devices on a node.
The following is an example of a NodePtpDevice CR created by the PTP Operator:
9.3. Installing the PTP Operator Copier lienLien copié sur presse-papiers!
As a cluster administrator, you can install the PTP Operator using the OpenShift Container Platform CLI or the web console.
9.3.1. CLI: Installing the PTP Operator Copier lienLien copié sur presse-papiers!
As a cluster administrator, you can install the Operator using the CLI.
Prerequisites
- A cluster installed on bare-metal hardware with nodes that have hardware that supports PTP.
-
Install the OpenShift CLI (
oc). -
Log in as a user with
cluster-adminprivileges.
Procedure
To create a namespace for the PTP Operator, enter the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To create an Operator group for the Operator, enter the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Subscribe to the PTP Operator.
Run the following command to set the OpenShift Container Platform major and minor version as an environment variable, which is used as the
channelvalue in the next step.OC_VERSION=$(oc version -o yaml | grep openshiftVersion | \ grep -o '[0-9]*[.][0-9]*' | head -1)$ OC_VERSION=$(oc version -o yaml | grep openshiftVersion | \ grep -o '[0-9]*[.][0-9]*' | head -1)Copy to Clipboard Copied! Toggle word wrap Toggle overflow To create a subscription for the PTP Operator, enter the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
To verify that the Operator is installed, enter the following command:
oc get csv -n openshift-ptp \ -o custom-columns=Name:.metadata.name,Phase:.status.phase
$ oc get csv -n openshift-ptp \ -o custom-columns=Name:.metadata.name,Phase:.status.phaseCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Name Phase ptp-operator.4.4.0-202006160135 Succeeded
Name Phase ptp-operator.4.4.0-202006160135 SucceededCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.3.2. Web console: Installing the PTP Operator Copier lienLien copié sur presse-papiers!
As a cluster administrator, you can install the Operator using the web console.
You have to create the namespace and operator group as mentioned in the previous section.
Procedure
Install the PTP Operator using the OpenShift Container Platform web console:
-
In the OpenShift Container Platform web console, click Operators
OperatorHub. - Choose PTP Operator from the list of available Operators, and then click Install.
- On the Install Operator page, under A specific namespace on the cluster select openshift-ptp. Then, click Install.
-
In the OpenShift Container Platform web console, click Operators
Optional: Verify that the PTP Operator installed successfully:
-
Switch to the Operators
Installed Operators page. Ensure that PTP Operator is listed in the openshift-ptp project with a Status of InstallSucceeded.
NoteDuring installation an Operator might display a Failed status. If the installation later succeeds with an InstallSucceeded message, you can ignore the Failed message.
If the operator does not appear as installed, to troubleshoot further:
-
Go to the Operators
Installed Operators page and inspect the Operator Subscriptions and Install Plans tabs for any failure or errors under Status. -
Go to the Workloads
Pods page and check the logs for pods in the openshift-ptpproject.
-
Go to the Operators
-
Switch to the Operators
9.4. Configuring Linuxptp services Copier lienLien copié sur presse-papiers!
The PTP Operator adds the PtpConfig.ptp.openshift.io custom resource definition (CRD) to OpenShift Container Platform. You can configure the Linuxptp services (ptp4l, phc2sys) by creating a PtpConfig custom resource (CR) object.
Prerequisites
-
Install the OpenShift CLI (
oc). -
Log in as a user with
cluster-adminprivileges. - You must have installed the PTP Operator.
Procedure
Create the following
PtpConfigCR, and then save the YAML in the<name>-ptp-config.yamlfile. Replace<name>with the name for this configuration.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify a name for the
PtpConfigCR. - 2
- Specify the namespace where the PTP Operator is installed.
- 3
- Specify an array of one or more
profileobjects. - 4
- Specify the name of a profile object which is used to uniquely identify a profile object.
- 5
- Specify the network interface name to use by the
ptp4lservice, for exampleens787f1. - 6
- Specify system config options for the
ptp4lservice, for example-s -2. This should not include the interface name-i <interface>and service config file-f /etc/ptp4l.confbecause these will be automatically appended. - 7
- Specify system config options for the
phc2sysservice, for example-a -r. - 8
- Specify an array of one or more
recommendobjects which define rules on how theprofileshould be applied to nodes. - 9
- Specify the
profileobject name defined in theprofilesection. - 10
- Specify the
prioritywith an integer value between0and99. A larger number gets lower priority, so a priority of99is lower than a priority of10. If a node can be matched with multiple profiles according to rules defined in thematchfield, the profile with the higher priority will be applied to that node. - 11
- Specify
matchrules withnodeLabelornodeName. - 12
- Specify
nodeLabelwith thekeyofnode.Labelsfrom the node object. - 13
- Specify
nodeNamewithnode.Namefrom the node object.
Create the CR by running the following command:
oc create -f <filename>
$ oc create -f <filename>1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
<filename>with the name of the file you created in the previous step.
Optional: Check that the
PtpConfigprofile is applied to nodes that match withnodeLabelornodeName.oc get pods -n openshift-ptp -o wide
$ oc get pods -n openshift-ptp -o wideCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
Profile Nameis the name that is applied to nodedev-worker-0.- 2
Interfaceis the PTP device specified in theprofile1interface field. Theptp4lservice runs on this interface.- 3
Ptp4lOptsare the ptp4l sysconfig options specified inprofile1Ptp4lOpts field.- 4
Phc2sysOptsare the phc2sys sysconfig options specified inprofile1Phc2sysOpts field.