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

bearerTokenSecret missing on Conversion from ServiceMonitor to VMServiceScrape since 0.43.0 #932

Closed
marrau opened this issue Apr 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@marrau
Copy link

marrau commented Apr 22, 2024

When Upgrading from 0.42.4 to 0.43.1 any ServiceMonitor with a bearerTokenSecret set, gets Permission denied on scraping.

Example:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: test-service
spec:
  endpoints:
  - bearerTokenSecret:
      key: PRIVATE_API_KEY
      name: test-secret
    honorLabels: false
    interval: 15s
    path: /metrics
    scrapeTimeout: 15s
    targetPort: 80
  jobLabel: test
  selector:
    matchLabels:
      test: test

Result on 0.43.+ (shortened Output):

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
  name: test-service
spec:
  attach_metadata: {}
  endpoints:
  - attach_metadata: {}
    interval: 15s
    path: /metrics
    scrapeTimeout: 15s
    targetPort: 80
  jobLabel: test
  namespaceSelector: {}
  selector:
    matchLabels:
      test: test

Result on 0.42.4 (shortened Output):

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
  name: test-service
spec:
  endpoints:
  - attach_metadata: {}
    bearerTokenSecret:
      key: PRIVATE_API_KEY
      name: test-secret
    interval: 15s
    path: /metrics
    scrapeTimeout: 15s
    targetPort: 80
  jobLabel: test
  namespaceSelector: {}
  selector:
    matchLabels:
      test: test
@marrau
Copy link
Author

marrau commented Apr 22, 2024

Found it to be removed in Commit 0500abb

@f41gh7 f41gh7 added the bug Something isn't working label Apr 22, 2024
@f41gh7
Copy link
Collaborator

f41gh7 commented Apr 22, 2024

Looks like bug to me, @Haleygo can you confirm?

@Haleygo
Copy link
Contributor

Haleygo commented Apr 23, 2024

Hi @marrau ,
Thanks for the issue, it should be fixed in #935.
JFYI, prometheus operator has marked BearerTokenSecret as deprecated and recommended to use authorization instead.

@Haleygo
Copy link
Contributor

Haleygo commented Apr 25, 2024

The fix is released in https://github.com/VictoriaMetrics/operator/releases/tag/v0.43.3, close this as completed, feel free to reopen if there is further question.

@Haleygo Haleygo closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants