Skip to content

Commit

Permalink
add prometheus monitor for image-controller (#3092)
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Cerven <[email protected]>
  • Loading branch information
rcerven authored Jan 18, 2024
1 parent 1379915 commit 14f1eda
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/image-controller/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
resources:
- allow-argocd-to-manage.yaml
- monitoring.yaml
- rbac

namespace: image-controller
Expand Down
43 changes: 43 additions & 0 deletions components/image-controller/base/monitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: metrics-reader
---
apiVersion: v1
kind: Secret
metadata:
name: metrics-reader
annotations:
kubernetes.io/service-account.name: metrics-reader
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus-image-controller-metrics-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: image-controller-metrics-reader
subjects:
- kind: ServiceAccount
name: metrics-reader
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: image-controller
spec:
endpoints:
- path: /metrics
interval: 15s
port: https
scheme: https
bearerTokenSecret:
name: "metrics-reader"
key: token
tlsConfig:
insecureSkipVerify: true
selector:
matchLabels:
control-plane: controller-manager

0 comments on commit 14f1eda

Please sign in to comment.