Skip to content

Commit

Permalink
update KubeSaw member-operator's ServiceMonitor
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Ilario <[email protected]>
  • Loading branch information
filariow committed Feb 5, 2025
1 parent b56606c commit 4bbe886
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ namespace: toolchain-member-operator
resources:
- ./rbac
- ./olm
- ./monitoring
- ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- monitor.yaml
- prometheus-network-policy.yaml
- rbac.yaml
- serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: member-operator-metrics
labels:
control-plane: controller-manager
spec:
endpoints:
- interval: 15s
scheme: https
path: /metrics
port: https
authorization:
credentials:
key: token
name: member-operator-metrics-reader
tlsConfig:
insecureSkipVerify: true
selector:
matchLabels:
control-plane: controller-manager
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-openshift-user-workload-monitoring
namespace: system
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-user-workload-monitoring
podSelector: {}
policyTypes:
- Ingress
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: member-operator-metrics
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus-member-operator-metrics-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: member-operator-metrics
subjects:
- kind: ServiceAccount
name: member-operator-metrics-reader
namespace: system
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Secret
metadata:
annotations:
kubernetes.io/service-account.name: member-operator-metrics-reader
name: member-operator-metrics-reader
namespace: system
type: kubernetes.io/service-account-token
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: member-operator-metrics-reader
namespace: system

0 comments on commit 4bbe886

Please sign in to comment.