-
Notifications
You must be signed in to change notification settings - Fork 98
fix(valkey-operator): align ServiceMonitor with metrics.secure (skip-verify opt-in) #231
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,20 +15,27 @@ metadata: | |
| {{- end }} | ||
| spec: | ||
| endpoints: | ||
| - port: http | ||
| # Port name must match metrics-service.yaml (http when insecure, https when metrics.secure). | ||
| - port: {{ if .Values.metrics.secure }}https{{ else }}http{{ end }} | ||
| honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} | ||
| {{- with .Values.metrics.serviceMonitor.interval }} | ||
| interval: {{ . }} | ||
| {{- end }} | ||
| {{- with .Values.metrics.serviceMonitor.scrapeTimeout }} | ||
| scrapeTimeout: {{ . }} | ||
| {{- end }} | ||
| {{- with .Values.metrics.serviceMonitor.scheme }} | ||
| scheme: {{ . }} | ||
| {{- if .Values.metrics.serviceMonitor.scheme }} | ||
| scheme: {{ .Values.metrics.serviceMonitor.scheme }} | ||
| {{- else if .Values.metrics.secure }} | ||
| scheme: https | ||
| {{- end }} | ||
| {{- with .Values.metrics.serviceMonitor.tlsConfig }} | ||
| {{- if .Values.metrics.serviceMonitor.tlsConfig }} | ||
| tlsConfig: | ||
| {{- toYaml . | nindent 6 }} | ||
| {{- toYaml .Values.metrics.serviceMonitor.tlsConfig | nindent 6 }} | ||
| {{- else if and .Values.metrics.secure .Values.metrics.serviceMonitor.insecureSkipVerify }} | ||
| # Opt-in: operator metrics use a self-signed cert by default. | ||
| tlsConfig: | ||
| insecureSkipVerify: true | ||
|
Comment on lines
+18
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The focused ServiceMonitor suite only asserts the default insecure Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! ArtifactsSecure metrics authentication-path test source
HTTPS metrics request without ServiceMonitor authentication
HTTPS metrics request with bound service account Bearer token
ServiceMonitor coverage and rendering harness source
Current ServiceMonitor unit suite passes without secure branch cases
Secure ServiceMonitor branch coverage check and live renders
Valkey operator chart lint result
|
||
| {{- end }} | ||
| {{- with .Values.metrics.serviceMonitor.relabelings }} | ||
| relabelings: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
metrics.secureis enabled, this endpoint selects HTTPS but does not configureauthorizationor a bearer-token secret. The protected operator metrics endpoint requires the metrics-reader service-account token, so Prometheus sends an unauthenticated scrape and receives401even when the intended scraper identity has the required RBAC binding. Add a documented Secret-backed authorization configuration to the ServiceMonitor endpoint for secure metrics.Artifacts
Secure metrics authentication-path test source
HTTPS metrics request without ServiceMonitor authentication
HTTPS metrics request with bound service account Bearer token