Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update sandbox host-operator's ServiceMonitor #5441

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ namespace: toolchain-host-operator
resources:
- sandbox-registration-service-proxy.yaml
- prometheus-network-policy.yaml
- monitor.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: host-operator-metrics
labels:
apps: host-operator
spec:
endpoints:
- interval: 15s
scheme: https
path: /metrics
port: http
authorization:
credentials:
key: token
name: host-operator-metrics-reader
tlsConfig:
insecureSkipVerify: true
selector:
matchLabels:
apps: host-operator
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-openshift-user-workload-monitoring
namespace: toolchain-host-operator
namespace: system
spec:
ingress:
- from:
Expand All @@ -11,4 +11,4 @@ spec:
kubernetes.io/metadata.name: openshift-user-workload-monitoring
podSelector: {}
policyTypes:
- Ingress
- 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: host-operator-metrics
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus-host-operator-metrics-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: host-operator-metrics
subjects:
- kind: ServiceAccount
name: host-operator-metrics-reader
namespace: system
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: metrics-reader
namespace: toolchain-host-operator
name: registration-service-metrics-reader
namespace: system
---
apiVersion: v1
kind: Secret
metadata:
name: metrics-reader
namespace: toolchain-host-operator
name: registration-service-metrics-reader
namespace: system
annotations:
kubernetes.io/service-account.name: metrics-reader
kubernetes.io/service-account.name: registration-service-metrics-reader
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -33,23 +33,23 @@ roleRef:
name: registration-service-metrics-reader
subjects:
- kind: ServiceAccount
name: metrics-reader
namespace: toolchain-host-operator
name: registration-service-metrics-reader
namespace: system
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: sandbox-registration-service-proxy
namespace: toolchain-host-operator
namespace: system
spec:
endpoints:
- interval: 15s
scheme: http
path: /metrics
port: proxy-metrics
bearerTokenSecret:
name: "metrics-reader"
name: "registration-service-metrics-reader"
key: token
selector:
matchLabels:
run: proxy-metrics
run: proxy-metrics
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: host-operator-metrics-reader
name: host-operator-metrics-reader
namespace: system
type: kubernetes.io/service-account-token
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: host-operator-metrics-reader
namespace: system