apiVersion: v1
kind: Namespace
metadata:
  labels:
    control-plane: controller-manager
    openshift.io/cluster-monitoring: "true"
  name: openshift-nfd
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: openshift-nfd
  labels:
    control-plane: controller-manager
spec:
  selector:
    matchLabels:
      control-plane: controller-manager
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: controller-manager
    spec:
      serviceAccountName: nfd-operator
      containers:
        - name: manager
          securityContext:
            readOnlyRootFilesystem: true
            allowPrivilegeEscalation: false
            capabilities:
              drop: ["ALL"]
          command:
            - /node-feature-discovery-operator
          args:
            - --leader-elect
            - "--zap-encoder=console"
            - "--zap-log-level=debug"
          image: controller:latest
          env:
            - name: SSL_CERT_DIR
              value: "/etc/pki/tls/certs"
            - 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/openshift/origin-node-feature-discovery:4.9"
          ports:
            - name: metrics
              containerPort: 8080
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8081
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /readyz
              port: 8081
            initialDelaySeconds: 5
            periodSeconds: 10
      terminationGracePeriodSeconds: 10
