# This patch inject a sidecar container which is a HTTP proxy for the
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: openshift-nfd
spec:
  template:
    spec:
      containers:
        - name: kube-rbac-proxy
          image: kube-rbac-proxy
          args:
            - "--secure-listen-address=0.0.0.0:8443"
            - "--upstream=http://127.0.0.1:8080/"
            - "--logtostderr=true"
            - "--v=10"
            - "--tls-cert-file=/etc/secrets/tls.crt"
            - "--tls-private-key-file=/etc/secrets/tls.key"
            - "--tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
          ports:
            - containerPort: 8443
              name: https
          volumeMounts:
            - name: node-feature-discovery-operator-tls
              mountPath: /etc/secrets
          resources:
            requests:
              memory: "64Mi"
              cpu: "250m"
            limits:
              memory: "128Mi"
              cpu: "500m"
          securityContext:
            readOnlyRootFilesystem: true
        - name: manager
          args:
            - "--metrics-bind-address=127.0.0.1:8080"
            - "--leader-elect"
      volumes:
        - name: node-feature-discovery-operator-tls
          secret:
            secretName: node-feature-discovery-operator-tls
