Coder Social home page Coder Social logo

ptp-operator's Introduction

PTP Operator

Table of Contents

PTP Operator

Ptp Operator, runs in openshift-ptp namespace, manages cluster wide PTP configuration. It offers PtpOperatorConfig and PtpConfig CRDs and creates linuxptp daemon to apply node specific PTP config.

PtpOperatorConfig

Upon deployment of PTP Operator, it automatically creates a default custom resource of PtpOperatorConfig kind which contains a configurable option daemonNodeSelector, it is used to specify which nodes linuxptp daemon shall be created on. The daemonNodeSelector will be applied to linuxptp daemon DaemonSet nodeSelector field and trigger relaunching of linuxptp daemon. Ptp Operator only recognizes default PtpOperatorConfig, use oc edit PtpOperatorConfig default -n openshift-ptp to update the daemonNodeSelector.

$ oc get ptpoperatorconfigs.ptp.openshift.io default -n openshift-ptp -o yaml

apiVersion: v1
items:
- apiVersion: ptp.openshift.io/v1
  kind: PtpOperatorConfig
  metadata:
    creationTimestamp: "2019-10-28T06:53:09Z"
    generation: 3
    name: default
    namespace: openshift-ptp
    resourceVersion: "2356742"
    selfLink: /apis/ptp.openshift.io/v1/namespaces/openshift-ptp/ptpoperatorconfigs/default
    uid: d7286542-34bd-4c79-8533-d01e2b25953e
  spec:
    daemonNodeSelector: {}
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

Below is an example of updating daemonNodeSelector to select all worker nodes:

$ oc edit ptpoperatorconfigs.ptp.openshift.io default -n openshift-ptp

apiVersion: v1
items:
- apiVersion: ptp.openshift.io/v1
  kind: PtpOperatorConfig
  metadata:
    creationTimestamp: "2019-10-28T06:53:09Z"
    generation: 4
    name: default
    namespace: openshift-ptp
    resourceVersion: "2364095"
    selfLink: /apis/ptp.openshift.io/v1/namespaces/openshift-ptp/ptpoperatorconfigs/default
    uid: d7286542-34bd-4c79-8533-d01e2b25953e
  spec:
    daemonNodeSelector:
      node-role.kubernetes.io/worker: ""
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

PtpConfig

PtpConfig CRD is used to define linuxptp configurations and to which node these linuxptp configurations shall be applied. The Spec of CR has two major sections. The first section profile contains interface, ptp4lOpts and phc2sysOpts options, the second recommend defines profile selection logic.

apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
  name: example-ptpconfig
  namespace: ptp
spec:
  profile:
  - name: "profile1"
    interface: "enp134s0f0"
    ptp4lOpts: "-s -2"
    phc2sysOpts: "-a -r"
  recommend:
  - profile: "profile1"
    priority: 4
    match:
    - nodeLabel: "node-role.kubernetes.io/worker"

In above example, profile1 will be applied by linuxptp-daemon to nodes labeled with node-role.kubernetes.io/worker.

example-ptpconfig CR is created with PtpConfig kind. spec.profile defines profile named profile1 which contains interface (enp134s0f0) to run ptp4l process on, ptp4lOpts (-s -2) sysconfig options to run ptp4l process with and phc2sysOpts (-a -r) to run phc2sys process with. spec.recommend defines priority (lower numbers mean higher priority, 0 is the highest priority) and match rules of profile profile1. priority is useful when there are multiple PtpConfig CRs defined, linuxptp daemon applies match rules against node labels and names from high priority to low priority in order. If any of nodeLabel or nodeName on a specific node matches with the node label or name where daemon runs, it applies profile on that node.

Quick Start

To install PTP Operator:

$ make deploy

To un-install:

$ make undeploy

ptp-operator's People

Contributors

openshift-merge-robot avatar zshi-redhat avatar schseba avatar fedepaol avatar aneeshkp avatar oribon avatar josephdrichard avatar jupierce avatar sabinaaledort avatar openshift-bot avatar openshift-ci[bot] avatar thiagoalessio avatar dbaker-rh avatar evgenlevin avatar lack avatar thrasher-redhat avatar vitus133 avatar williamcaban avatar yselkowitz avatar dougbtv avatar openshift-ci-robot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.