feat(monitoring): add Victoria Metrics cluster for ingesting Home Assistant metrics
This commit is contained in:
parent
a90c29e276
commit
99f90e1544
7 changed files with 112 additions and 0 deletions
7
apps/monitoring/base/kustomization.yaml
Normal file
7
apps/monitoring/base/kustomization.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- vmagent.yaml
|
||||
- vmauth.yaml
|
||||
- vmcluster.yaml
|
||||
- vmuser-homeassistant.yaml
|
||||
8
apps/monitoring/base/vmagent.yaml
Normal file
8
apps/monitoring/base/vmagent.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMAgent
|
||||
metadata:
|
||||
name: metrics
|
||||
spec:
|
||||
selectAllByDefault: true
|
||||
remoteWrite:
|
||||
- url: "http://vminsert-metrics.monitoring-system.svc:8480/insert/0/prometheus/api/v1/write"
|
||||
11
apps/monitoring/base/vmauth.yaml
Normal file
11
apps/monitoring/base/vmauth.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMAuth
|
||||
metadata:
|
||||
name: metrics-auth
|
||||
spec:
|
||||
selectAllByDefault: true
|
||||
userNamespaceSelector: {}
|
||||
userSelector: {}
|
||||
ingress:
|
||||
class_name: nginx
|
||||
host: metrics.int.nc.landry.land
|
||||
45
apps/monitoring/base/vmcluster.yaml
Normal file
45
apps/monitoring/base/vmcluster.yaml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMCluster
|
||||
metadata:
|
||||
name: metrics
|
||||
spec:
|
||||
retentionPeriod: "1"
|
||||
replicationFactor: 2
|
||||
vmstorage:
|
||||
replicaCount: 2
|
||||
storageDataPath: "/vm-data"
|
||||
storage:
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: "10Gi"
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
vmselect:
|
||||
replicaCount: 2
|
||||
cacheMountPath: "/select-cache"
|
||||
storage:
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: "1Gi"
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "500Mi"
|
||||
vminsert:
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "500Mi"
|
||||
24
apps/monitoring/base/vmuser-homeassistant.yaml
Normal file
24
apps/monitoring/base/vmuser-homeassistant.yaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMUser
|
||||
metadata:
|
||||
name: metrics-user-home-assistant
|
||||
spec:
|
||||
name: ha-metrics
|
||||
username: ha-metrics
|
||||
generatePassword: true
|
||||
targetRefs:
|
||||
# vmui + vmselect
|
||||
- crd:
|
||||
kind: VMCluster/vmselect
|
||||
name: metrics
|
||||
namespace: monitoring-system
|
||||
target_path_suffix: "/select/0"
|
||||
paths:
|
||||
- "/vmui"
|
||||
- "/vmui/.*"
|
||||
- "/prometheus/api/v1/query"
|
||||
- "/prometheus/api/v1/query_range"
|
||||
- "/prometheus/api/v1/series"
|
||||
- "/prometheus/api/v1/status/.*"
|
||||
- "/prometheus/api/v1/label/"
|
||||
- "/prometheus/api/v1/label/[^/]+/values"
|
||||
11
apps/monitoring/overlays/system/config.json
Normal file
11
apps/monitoring/overlays/system/config.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"appName": "monitoring",
|
||||
"userGivenName": "monitoring",
|
||||
"destNamespace": "monitoring-system",
|
||||
"destServer": "https://kubernetes.default.svc",
|
||||
"srcPath": "apps/monitoring/overlays/system",
|
||||
"srcRepoURL": "ssh://git@gitea-ssh.gitops.svc.cluster.local:2222/davad/argo.git",
|
||||
"srcTargetRevision": "",
|
||||
"labels": null,
|
||||
"annotations": null
|
||||
}
|
||||
6
apps/monitoring/overlays/system/kustomization.yaml
Normal file
6
apps/monitoring/overlays/system/kustomization.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../base
|
||||
|
||||
namespace: victoriametrics-system
|
||||
Loading…
Add table
Add a link
Reference in a new issue