Skip to content

Commit 9bf3637

Browse files
Merge pull request #19318 from simonpasquier/fix-17685
Allow Prometheus to get metrics from the router
2 parents be66ee3 + f4e6656 commit 9bf3637

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

pkg/cmd/server/bootstrappolicy/policy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ func GetOpenshiftBootstrapClusterRoles() []rbac.ClusterRole {
564564
rbac.NewRule("list", "watch").Groups(kapiGroup).Resources("endpoints").RuleOrDie(),
565565
rbac.NewRule("list", "watch").Groups(kapiGroup).Resources("services").RuleOrDie(),
566566

567+
rbac.NewRule("create").Groups(kAuthnGroup).Resources("tokenreviews").RuleOrDie(),
567568
rbac.NewRule("create").Groups(kAuthzGroup).Resources("subjectaccessreviews").RuleOrDie(),
568569

569570
rbac.NewRule("list", "watch").Groups(routeGroup, legacyRouteGroup).Resources("routes").RuleOrDie(),

pkg/oc/admin/router/router.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,6 @@ func RunCmdRouter(f *clientcmd.Factory, cmd *cobra.Command, out, errout io.Write
791791
if t.Annotations == nil {
792792
t.Annotations = make(map[string]string)
793793
}
794-
t.Annotations["prometheus.io/scrape"] = "true"
795-
t.Annotations["prometheus.io/port"] = "1936"
796794
t.Annotations["prometheus.openshift.io/username"] = cfg.StatsUsername
797795
t.Annotations["prometheus.openshift.io/password"] = cfg.StatsPassword
798796
t.Spec.ClusterIP = clusterIP

test/testdata/bootstrappolicy/bootstrap_cluster_roles.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,12 @@ items:
17641764
verbs:
17651765
- list
17661766
- watch
1767+
- apiGroups:
1768+
- authentication.k8s.io
1769+
resources:
1770+
- tokenreviews
1771+
verbs:
1772+
- create
17671773
- apiGroups:
17681774
- authorization.k8s.io
17691775
resources:

test/testdata/bootstrappolicy/bootstrap_policy_file.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,13 @@ items:
19341934
verbs:
19351935
- list
19361936
- watch
1937+
- apiGroups:
1938+
- authentication.k8s.io
1939+
attributeRestrictions: null
1940+
resources:
1941+
- tokenreviews
1942+
verbs:
1943+
- create
19371944
- apiGroups:
19381945
- authorization.k8s.io
19391946
attributeRestrictions: null

0 commit comments

Comments
 (0)