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
40 changes: 40 additions & 0 deletions manifests/0000_90_console_01_prometheusrbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Role for accessing metrics exposed by the console
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus-k8s
namespace: openshift-console
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- pods
verbs:
- get
- list
- watch
---
# Grant cluster-monitoring access to console metrics
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prometheus-k8s
namespace: openshift-console
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus-k8s
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: openshift-monitoring
24 changes: 24 additions & 0 deletions manifests/0000_90_console_02_servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Configure cluster-monitoring for console
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: console
namespace: openshift-console
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
interval: 30s
path: /metrics
port: https
scheme: https
tlsConfig:
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
serverName: console.openshift-console.svc
jobLabel: component
selector:
matchLabels:
app: console
1 change: 1 addition & 0 deletions manifests/02-namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metadata:
workload.openshift.io/allowed: "management"
labels:
network.openshift.io/policy-group: "console"
openshift.io/cluster-monitoring: "true"
---
apiVersion: v1
kind: Namespace
Expand Down
20 changes: 20 additions & 0 deletions manifests/04-rbac-rolebinding-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,23 @@ roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: helm-chartrepos-viewer
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: console-auth-delegator
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
roleRef:
# for protected endpoints like /metrics, the console backend must perform
# authentication (tokenreview) & authorization (subjectaccessreview)
# which are granted by this ClusterRole
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: console
namespace: openshift-console
18 changes: 18 additions & 0 deletions manifests/04-rbac-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,21 @@ subjects:
- kind: ServiceAccount
name: console
namespace: openshift-console
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: console
namespace: kube-system
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
roleRef:
kind: Role
name: extension-apiserver-authentication-reader
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: console
namespace: openshift-console