Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many warnings for Prometheus Operator 0.73.0 "'bearerTokenFile' is deprecated, use 'authorization' instead." #6493

Closed
1 task done
Jack296s opened this issue Apr 10, 2024 · 3 comments
Labels

Comments

@Jack296s
Copy link

Jack296s commented Apr 10, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Description

Prometheus Operator 0.73.0, too many warnings for "'bearerTokenFile' is deprecated, use 'authorization' instead." see below

level=info ts=2024-04-10T00:11:25.626328388Z caller=main.go:186 msg="Starting Prometheus Operator" version="(version=0.73.0, branch=, revision=unknown)"
level=info ts=2024-04-10T00:11:25.626384961Z caller=main.go:187 build_context="(go=go1.22.2, platform=linux/amd64, user=, date=20240404-09:17:29, tags=unknown)"
level=info ts=2024-04-10T00:11:25.626394609Z caller=main.go:198 msg="namespaces filtering configuration " config="{allow_list=\"\",deny_list=\"\",prometheus_allow_list=\"\",alertmanager_allow_list=\"\",alertmanagerconfig_allow_list=\"\",thanosruler_allow_list=\"\"}"
level=info ts=2024-04-10T00:11:25.63146596Z caller=main.go:227 msg="connection established" cluster-version=v1.24.17
level=info ts=2024-04-10T00:11:25.663438527Z caller=operator.go:335 component=prometheus-controller msg="Kubernetes API capabilities" endpointslices=true
level=info ts=2024-04-10T00:11:25.679068736Z caller=operator.go:320 component=prometheusagent-controller msg="Kubernetes API capabilities" endpointslices=true
level=info ts=2024-04-10T00:11:25.712511639Z caller=server.go:298 msg="starting insecure server" address=[::]:8080
level=info ts=2024-04-10T00:11:26.356414111Z caller=operator.go:429 component=prometheusagent-controller msg="successfully synced all caches"
level=info ts=2024-04-10T00:11:26.357127012Z caller=operator.go:313 component=alertmanager-controller msg="successfully synced all caches"
level=info ts=2024-04-10T00:11:26.357175525Z caller=operator.go:283 component=thanos-controller msg="successfully synced all caches"
level=warn ts=2024-04-10T00:11:26.595531046Z caller=promcfg.go:1374 component=prometheus-controller msg="'bearerTokenFile' is deprecated, use 'authorization' instead." version=v2.51.1 service_monitor=monitoring/dev-c2-kube-prometheus-apiserver
level=warn ts=2024-04-10T00:11:26.595572632Z caller=promcfg.go:1374 component=prometheus-controller msg="'bearerTokenFile' is deprecated, use 'authorization' instead." version=v2.51.1 service_monitor=monitoring/dev-c2-kube-prometheus-coredns
level=warn ts=2024-04-10T00:11:26.595592351Z caller=promcfg.go:1374 component=prometheus-controller msg="'bearerTokenFile' is deprecated, use 'authorization' instead." version=v2.51.1 service_monitor=monitoring/dev-c2-kube-prometheus-kube-controller-manager
level=warn ts=2024-04-10T00:11:26.595609821Z caller=promcfg.go:1374 component=prometheus-controller msg="'bearerTokenFile' is deprecated, use 'authorization' instead." version=v2.51.1 service_monitor=monitoring/dev-c2-kube-prometheus-kube-proxy
level=warn ts=2024-04-10T00:11:26.595626565Z caller=promcfg.go:1374 component=prometheus-controller msg="'bearerTokenFile' is deprecated, use 'authorization' instead." version=v2.51.1 service_monitor=monitoring/dev-c2-kube-prometheus-kube-scheduler
level=warn ts=2024-04-10T00:11:26.59567254Z caller=promcfg.go:1374 component=prometheus-controller msg="'bearerTokenFile' is deprecated, use 'authorization' instead." version=v2.51.1 service_monitor=monitoring/dev-c2-kube-prometheus-kubelet
(repeatedly)

example servicemonitor with bearerTokenFile that causes warinings in prometheus operator

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
...
spec:
   endpoints:
   - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
...

Steps to Reproduce

  1. Install Prometheus Operator 0.73.0
  2. Servicemonitor with bearerTokenFile
  3. Check prometheus-operator logs

Expected Result

no warnings or just warnings once

Actual Result

too many warnings for "'bearerTokenFile' is deprecated, use 'authorization' instead."

Prometheus Operator Version

0.73.0

Kubernetes Version

1.24.17

Kubernetes Cluster Type

Other (please comment): K8S

How did you deploy Prometheus-Operator?

Other (please comment): Helm Chart bitnami/kube-prometheus

Manifests

No response

prometheus-operator log output

level=warn ts=2024-04-10T00:11:26.595531046Z caller=promcfg.go:1374 component=prometheus-controller msg="'bearerTokenFile' is deprecated, use 'authorization' instead." version=v2.51.1 service_monitor=monitoring/dev-c2-kube-prometheus-apiserver

Anything else?

No response

@Jack296s Jack296s added kind/bug needs-triage Issues that haven't been triaged yet labels Apr 10, 2024
@slashpai
Copy link
Contributor

Technically not a bug this is showing in logs since more context added in log here https://github.com/prometheus-operator/prometheus-operator/pull/6410/files#diff-453ce9c721c51bf9591c2b212e9ce50157b9c40d1b211177bf502be268099656R1352 since a deprecated field

A fix would be to use the new scrapeClasses feature from Prometheus CRD which would automatically inject the authorization credentials

may be a documentation for scrapeClass would be good

cc: @nicolastakashi @simonpasquier

@slashpai slashpai added kind/documentation kind/support and removed kind/bug needs-triage Issues that haven't been triaged yet labels Apr 10, 2024
@simonpasquier
Copy link
Contributor

My feeling is that the logs are too aggressive indeed. I'll propose a patch and we can cut a 0.73.1 release after it.

@slashpai
Copy link
Contributor

This is fixed and patch release done 0.73.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants