Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/openshift/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resources:
- ../default
- cluster-monitoring-view-binding.yaml
- metrics-reader-token.yaml
- prometheus-metrics-auth-binding.yaml
- prometheus-metrics-reader-binding.yaml

patches:
- path: configmap-patch.yaml
Expand Down
14 changes: 0 additions & 14 deletions config/openshift/prometheus-metrics-auth-binding.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions config/openshift/prometheus-metrics-reader-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Grant GET /metrics permission to the controller-manager SA whose token is
# used by Prometheus (via authorization.credentials) to scrape the WVA
# metrics endpoint. The WVA metrics endpoint performs a SubjectAccessReview
# checking this permission.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: workload-variant-autoscaler-ocp-prometheus-metrics-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metrics-reader
subjects:
- kind: ServiceAccount
name: controller-manager
1 change: 1 addition & 0 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resources:
- metrics_auth_role_binding.yaml
- prometheus_metrics_auth_role_binding.yaml
- metrics_reader_role.yaml
- metrics_reader_role_binding.yaml
# EPP metrics reader service account with minimal privileges
- epp_metrics_service_account.yaml
- epp_metrics_reader_role.yaml
Expand Down
21 changes: 21 additions & 0 deletions config/rbac/metrics_reader_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Grant GET /metrics permission to the Prometheus SA so the
# SubjectAccessReview performed by the WVA metrics endpoint passes.
# This complements metrics_auth_role_binding.yaml (which grants
# tokenreview/SAR permissions to the controller-manager) and
# prometheus_metrics_auth_role_binding.yaml (which grants the
# Prometheus SA authentication permissions).
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metrics-reader-rolebinding
labels:
app.kubernetes.io/name: workload-variant-autoscaler
app.kubernetes.io/managed-by: kustomize
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metrics-reader
subjects:
- kind: ServiceAccount
name: kube-prometheus-stack-prometheus
namespace: workload-variant-autoscaler-monitoring
Loading