---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: linuxptp-daemon
  namespace: openshift-ptp
spec:
  selector:
    matchLabels:
      app: linuxptp-daemon
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: linuxptp-daemon
    spec:
      hostNetwork: true
      hostPID: true
      nodeSelector:
        kubernetes.io/os: linux
      tolerations:
      - operator: Exists
      serviceAccountName: linuxptp-daemon
      containers:
      - name: linuxptp-daemon-container
        securityContext:
          privileged: true
        image: openshift.io/linuxptp-daemon
        command: [ "/bin/bash", "-c", "--" ]
        args: [ "/usr/local/bin/ptp --alsologtostderr" ]
        imagePullPolicy: IfNotPresent
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        volumeMounts:
        - name: config-volume
          mountPath: /etc/linuxptp
      volumes:
        - name: config-volume
          configMap:
            name: linuxptp-configmap
