<p>What is the issue with my manifest file?</p>
<pre><code>cat manifests/node-exporter-clusterRoleBinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: node-exporter
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: node-exporter
subjects:
- kind: ServiceAccount
  name: node-exporter

cat manifests/kube-state-metrics-clusterRoleBinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kube-state-metrics
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: kube-state-metrics
subjects:
- kind: ServiceAccount
  name: kube-state-metrics
</code></pre>
<p>If I apply these manifest with namespace I get an error as like below:</p>
<pre><code>
kubectl -f manifests/kube-state-metrics-clusterRoleBinding.yaml -n test-monitoring

The ClusterRoleBinding &quot;node-exporter&quot; is invalid: subjects[0].namespace: Required value

kubectl apply -f manifests/kube-state-metrics-clusterRoleBinding.yaml -n test-monitoring

The ClusterRoleBinding &quot;kube-state-metrics&quot; is invalid: subjects[0].namespace: Required value
</code></pre>
<p>Any issue with manifests files?</p>

learner
<p>As a <code>ServiceAccount</code> is a namespaced object, you need to explicitly add the <code>namespace</code> of the <code>ServiceAccount</code> as:</p>
<pre><code>subjects:
- kind: ServiceAccount
  name: kube-state-metrics
  namespace: &lt;namespace-of-kube-state-metrics-serviceaccount&gt;
</code></pre>
