apiVersion: v1
kind: Namespace
metadata:
  name: openshift-ptp
  labels:
    name: openshift-ptp
    openshift.io/cluster-monitoring: "true"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ptp-operator
  namespace: openshift-ptp
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ptp-operator
  template:
    metadata:
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
      labels:
        name: ptp-operator
    spec:
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
        operator: Exists
      serviceAccountName: ptp-operator
      containers:
        - name: ptp-operator
          # Replaces this with the image name
          image: controller
          command:
          - ptp-operator
          args:
          - --enable-leader-election
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 50m
              memory: 100Mi
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: $OPERATOR_NAME
            - name: RELEASE_VERSION
              value: $RELEASE_VERSION
            - name: LINUXPTP_DAEMON_IMAGE
              value: $LINUXPTP_DAEMON_IMAGE
            - name: KUBE_RBAC_PROXY_IMAGE
              value: $KUBE_RBAC_PROXY_IMAGE
