Added prometheus monitor
This commit is contained in:
1 parent
5876a36f61
commit
b772998c22
3 files changed
+59
No files matched your search
@@ -0,0 +1,30 @@
|
||||
{{ define "homelab.prom.svcm" }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Endpoints
|
||||
metadata:
|
||||
name: "rp-metrics-{{.name}}"
|
||||
labels:
|
||||
app.kubernetes.io/name: rp-metrics
|
||||
app.kubernetes.io/instance: {{ .name }}
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: "{{ .ip }}"
|
||||
ports:
|
||||
- port: {{ .port | default 80 }}
|
||||
protocol: TCP
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: "rp-metrics-{{.name}}"
|
||||
labels:
|
||||
app.kubernetes.io/name: rp-metrics
|
||||
app.kubernetes.io/instance: {{ .name }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: {{ .port | default 9100 }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/managed-by: argoapps
|
||||
app.kubernetes.io/name: external-svc-monitor
|
||||
name: external-svc-monitor
|
||||
spec:
|
||||
endpoints:
|
||||
- honorLabels: true
|
||||
path: "/metrics"
|
||||
port: 80
|
||||
scheme: http
|
||||
scrapeTimeout: "30s"
|
||||
jobLabel: external-svc-monitor
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: rp-metrics
|
||||
|
||||
{{- range $def := .Values.externalPrometheusExporters }}
|
||||
|
||||
{{ include "homelab.prom.svcm" $def }}
|
||||
|
||||
{{ end -}}
|
||||
@@ -216,3 +216,7 @@ storage:
|
||||
storage: 20Gi
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
externalPrometheusExporters:
|
||||
- name: fwbook
|
||||
ip: 10.0.0.119
|
||||
Reference in new issue
Block a user