<p>I have deployed kube-state-metrics into kube-system namespace and in the same cluster we are having prometheus-operator running I've written the below service monitor file for sending metrics to prometheus but it is not working. Please find the files below.</p>
<p>Servicemonitor.yaml</p>
<pre><code>apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: kube-state-metrics
  labels:
    app.kubernetes.io/name: kube-state-metrics
  namespace: kube-system
spec:
  selector:
    matchLabels:
      prometheus-scrape: &quot;true&quot;
  endpoints:
    - port: metrics
      path: /metrics
      targetPort: 8080
      honorLabels: true
      scheme: https
      tlsConfig:
        insecureSkipVerify: true
</code></pre>
<p>Prometheus-deploy.yaml</p>
<pre><code>apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  annotations:
    argocd.argoproj.io/sync-wave: &quot;1&quot;
  name: prometheus
  labels:
    name: prometheus
spec:
  serviceAccountName: prometheus
  serviceMonitorSelector: {}
  serviceMonitorNamespaceSelector:
    matchLabels:
      prometheus-scrape: &quot;true&quot;
  podMonitorSelector: {}
  podMonitorNamespaceSelector:
    matchLabels:
      prometheus-scrape: &quot;true&quot;
  resources:
    requests:
      memory: 400Mi
  enableAdminAPI: false
  additionalScrapeConfigs:
    name: additional-scrape-configs
    key: prometheus-additional.yaml
</code></pre>
<p>Can any one please help me out regarding this issue.</p>
<p>Thanks.</p>

<p>ServiceMonitor's selector&gt;matchLabels should match with &quot;Service&quot;'s labels. Check if your service has correct label.</p>
