---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: linuxptp-daemon
  namespace: openshift-ptp
  annotations:
    release.openshift.io/version: "{{.ReleaseVersion}}"
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: {{.Image}}
        command: [ "/bin/bash", "-c", "--" ]
        args: [ "/usr/local/bin/ptp --alsologtostderr -v 10" ]
        imagePullPolicy: IfNotPresent
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        volumeMounts:
        - name: config-volume
          mountPath: /etc/linuxptp
      volumes:
        - name: config-volume
          configMap:
            name: ptp-configmap
