apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfd-operator
  namespace: REPLACE_NAMESPACE
spec:
  replicas: 1
  selector:
    matchLabels:
      name: nfd-operator
  template:
    metadata:
      labels:
        name: nfd-operator
    spec:
      serviceAccountName: nfd-operator
      containers:
        - name: nfd-operator
          # Replace this with the built image name
          image: REPLACE_IMAGE
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - cluster-nfd-operator
          imagePullPolicy: IfNotPresent
          readinessProbe:
            exec:
              command:
                - stat
                - /tmp/operator-sdk-ready
            initialDelaySeconds: 4
            periodSeconds: 10
            failureThreshold: 1
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "cluster-nfd-operator"
            - name: NODE_FEATURE_DISCOVERY_IMAGE
              value: "quay.io/zvonkok/node-feature-discovery:v4.2"
          securityContext:
            readOnlyRootFilesystem: true
            allowPrivilegeEscalation: false
            capabilities:
              drop: ["ALL"]
          volumeMounts:
          - mountPath: /tmp
            name: tmp
      volumes:
      - name: tmp
        emptyDir: {}
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
        - key: "node-role.kubernetes.io/master"
          operator: "Equal"
          value: ""
          effect: "NoSchedule"

