basic authentication prometheus pod

I'm trying to add basic authentication for prometheus pod but when I deploy the pod with the below config I get the error: "Readiness probe failed: HTTP probe failed with statuscode: 401", I saw that this is a problem with "configuring the basic authentication" but maybe someone succeeded.

I've followed the prometheus tutorial from their webiste but without luck.

enter image description here

My deploymentconfig

- kind: ConfigMap
    apiVersion: v1
    metadata:
      name: prometheus-config
    data:
      prometheus.yml: |-
        global:
          scrape_interval: 30s
          scrape_timeout: 10s
          evaluation_interval: 10s
          external_labels:'
            type: 'kubernetes'
          .................etc
      web.yml: |-
        basic_auth_users:
            admin: fsdsdfsdfdsfdsft565tfg45wasfsdgfddggs
- kind: DeploymentConfig
    apiVersion: v1
    metadata:
      generation: 1
      labels:
        app: tools
      name: prometheus
    spec:
      replicas: 1
      revisionHistoryLimit: 3
      selector:
          affinity:
            podAntiAffinity:
          containers:
            - args:
                - '--storage.tsdb.retention.size=7GB'
                - '--storage.tsdb.path=/prometheus'
                - '--config.file=/etc/prometheus/prometheus.yml'
                - '--web.config.file=/etc/prometheus/web.yml'
                - '--web.enable-lifecycle'
              command:
                - /bin/prometheus

..................... etc

The pod is starting well with the args "--web.config.file=/etc/prometheus/web.yml" added in the deployment but the issue is that when basic authentication is enabled on endpoints used for liveness and readiness probes, resulting in the pod being killed. Other fact is when I'm trying to "curl -s -u admin htt://localhost:9090/metrics", it ask me for password and the is not showing anything.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum