File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,21 +41,6 @@ patches:
4141 target :
4242 kind : Deployment
4343
44-
45- replacements :
46- - source :
47- kind : Deployment
48- name : controller-manager
49- fieldPath : metadata.namespace
50- targets :
51- - select :
52- kind : ServiceMonitor
53- group : monitoring.coreos.com
54- version : v1
55- name : controller-manager-metrics-monitor
56- fieldPaths :
57- - spec.namespaceSelector.matchNames.0
58-
5944# Uncomment the patches line if you enable Metrics and CertManager
6045# [METRICS-WITH-CERTS] To enable metrics protected with certManager, uncomment the following line.
6146# This patch will protect the metrics with certManager self-signed certs.
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ kind: Kustomization
44resources :
55- ../default
66- cluster-monitoring-view-binding.yaml
7+ - metrics-reader-token.yaml
78
89patches :
910- path : configmap-patch.yaml
@@ -22,5 +23,9 @@ patches:
2223 target :
2324 kind : Deployment
2425 name : controller-manager
26+ - path : monitor-auth-patch.yaml
27+ target :
28+ kind : ServiceMonitor
29+ name : controller-manager-metrics-monitor
2530
2631namespace : workload-variant-autoscaler-system
Original file line number Diff line number Diff line change 1+ # Long-lived SA token for Prometheus to authenticate to the WVA metrics endpoint.
2+ # Required on OpenShift because user-workload-monitoring Prometheus rejects
3+ # bearerTokenFile for security. The ServiceMonitor is patched (via
4+ # monitor-auth-patch.yaml) to reference this Secret instead.
5+ apiVersion : v1
6+ kind : Secret
7+ metadata :
8+ name : workload-variant-autoscaler-metrics-reader-token
9+ namespace : system
10+ annotations :
11+ kubernetes.io/service-account.name : workload-variant-autoscaler-controller-manager
12+ type : kubernetes.io/service-account-token
Original file line number Diff line number Diff line change 1+ # Replace bearerTokenFile with authorization.credentials for OpenShift
2+ # user-workload-monitoring compatibility. The user-workload Prometheus Operator
3+ # rejects bearerTokenFile ("it accesses file system via bearer token file which
4+ # Prometheus specification prohibits").
5+ apiVersion : monitoring.coreos.com/v1
6+ kind : ServiceMonitor
7+ metadata :
8+ name : controller-manager-metrics-monitor
9+ namespace : system
10+ spec :
11+ endpoints :
12+ - port : https
13+ path : /metrics
14+ interval : 10s
15+ scheme : https
16+ tlsConfig :
17+ insecureSkipVerify : true
18+ authorization :
19+ credentials :
20+ name : workload-variant-autoscaler-metrics-reader-token
21+ key : token
You can’t perform that action at this time.
0 commit comments