feat(thin): add victoria-metrics for monitoring

This commit is contained in:
SeanOMik 2024-09-19 23:45:39 -04:00
parent e1647d2c8a
commit a7cbcbba62
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
9 changed files with 141 additions and 1 deletions

View File

@ -23,4 +23,13 @@ metadata:
namespace: flux-system
spec:
interval: 1m
url: https://kubernetes.github.io/ingress-nginx
url: https://kubernetes.github.io/ingress-nginx
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: victoria-metrics-charts
namespace: flux-system
spec:
interval: 1m
url: https://victoriametrics.github.io/helm-charts

View File

@ -17,4 +17,5 @@ resources:
- ./kubevirt-cdi/ks.yaml
- ../../common/apps/database
- ./monitoring
- ./default

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./victoria-metrics/ks.yaml

View File

@ -0,0 +1,56 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: victoria-metrics-operator
namespace: flux-system
spec:
targetNamespace: monitoring
timeout: 5m
interval: 10m
path: ./kubernetes/thin/apps/monitoring/victoria-metrics/operator
prune: true
sourceRef:
kind: GitRepository
name: home-cluster
decryption:
provider: sops
secretRef:
name: sops-gpg
postBuild:
substitute: {}
substituteFrom:
- kind: ConfigMap
name: cluster-settings
- kind: Secret
name: cluster-secrets
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: victoria-metrics-deploys
namespace: flux-system
spec:
targetNamespace: monitoring
timeout: 5m
interval: 10m
path: ./kubernetes/thin/apps/monitoring/victoria-metrics/vm
prune: true
sourceRef:
kind: GitRepository
name: home-cluster
decryption:
provider: sops
secretRef:
name: sops-gpg
dependsOn:
- name: victoria-metrics-operator
postBuild:
substitute: {}
substituteFrom:
- kind: ConfigMap
name: cluster-settings
- kind: Secret
name: cluster-secrets

View File

@ -0,0 +1,16 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: victoria-metrics-operator
namespace: monitoring
spec:
interval: 5m
chart:
spec:
chart: victoria-metrics-operator
version: 0.34.8
sourceRef:
kind: HelmRepository
name: victoria-metrics-charts
namespace: flux-system
values: {}

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helm-release.yaml

View File

@ -0,0 +1,17 @@
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAgent
metadata:
name: vmagent-select-all
namespace: monitoring
spec:
image:
repository: victoriametrics/vmagent
tag: v1.103.0
pullPolicy: IfNotPresent
selectAllByDefault: true
vmAgentExternalLabelName: vmagent
remoteWrite:
- url: http://vmsingle-vmsingle:8429/api/v1/write
minScrapeInterval: 30s
maxScrapeInterval: 24h

View File

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./single.yaml
- ./agent.yaml

View File

@ -0,0 +1,28 @@
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMSingle
metadata:
name: vmsingle
namespace: monitoring
spec:
image:
repository: victoriametrics/victoria-metrics
tag: v1.103.0
retentionPeriod: "6" # in months
replicaCount: 1
storage:
storageClassName: openebs-dual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 32Gi
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "500m"