I am currently running Prometheus inside a container in my Kubernetes cluster. My config states ::
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus
data:
prometheus.yml: |-
global:
scrape_interval: 5s
scrape_configs:
- job_name: 'kubernetes_apiserver'
tls_config:
insecure_skip_verify: true
kubernetes_sd_configs:
- api_servers:
- http://172.29.219.102:8080
role: apiserver
relabel_configs:
- source_labels: [__meta_kubernetes_role]
action: keep
regex: (?:apiserver)
###################### Kubernetes Pods ##########################
- job_name: 'haproxy'
static_configs:
- targets:
- 172.29.219.110:9101
- job_name: 'prometheus'
static_configs:
- targets:
- 172.29.219.110:9090
- job_name: 'kubernetes_pods'
tls_config:
insecure_skip_verify: true
kubernetes_sd_configs:
- api_servers:
- http://172.29.219.102:8080
role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name
As you can see, I have disables tls authentication for now by setting "insecure_skip_verify: true"
Once I bring up my pods and their relevant microservices, I get the ERROR ::
server returned HTTP status 401 Unauthorized

Please note I am using annotation to change /metrics to /websocket/metrics.
Now one way to get get rid of this is using certificates which I know is the most secure solution but what I am wondering is if I can disable the Authorization feature completely ONLY for /metrics ? Is there any such configuration ?