add vector-agent

This commit is contained in:
Joseph Hanson 2024-10-19 19:49:25 -05:00
parent 1594910dd2
commit e3167d2370
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
5 changed files with 115 additions and 0 deletions

View file

@ -9,5 +9,6 @@ resources:
- ./alertmanager/ks.yaml - ./alertmanager/ks.yaml
- ./gatus/ks.yaml - ./gatus/ks.yaml
- ./prometheus-operator-crds/ks.yaml - ./prometheus-operator-crds/ks.yaml
- ./vector-agent/ks.yaml
- ./vector-aggregator/ks.yaml - ./vector-aggregator/ks.yaml
- ./victoria-metrics/ks.yaml - ./victoria-metrics/ks.yaml

View file

@ -0,0 +1,47 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/helm.toolkit.fluxcd.io/helmrelease_v2.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: vector-agent
spec:
interval: 30m
chart:
spec:
chart: vector
version: 0.36.1
sourceRef:
kind: HelmRepository
name: vector
namespace: flux-system
driftDetection:
mode: enabled
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
values:
role: "Agent"
workloadResourceAnnotations:
reloader.stakater.com/auto: "true"
containerPorts:
- name: prom-exporter
containerPort: 9090
resources:
requests:
memory: "64Mi"
cpu: "500m"
limits:
memory: 1Gi
cpu: "6000m"
service:
ports:
- name: prom-exporter
port: 9090
existingConfigMaps: ["vector-agent-configmap"]
dataDir: /vector-data-dir
podMonitor:
enabled: true

View file

@ -0,0 +1,12 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
configMapGenerator:
- name: vector-agent-configmap
files:
- vector.yaml=./resources/vector.yml
generatorOptions:
disableNameSuffixHash: true

View file

@ -0,0 +1,35 @@
---
data_dir: /vector-data-dir
sources:
internal_metrics:
type: internal_metrics
kubernetes_logs:
type: kubernetes_logs
use_apiserver_cache: true
pod_annotation_fields:
container_image: container_image
container_name: container_name
pod_labels: pod_labels
pod_name: pod_name
pod_annotations: ""
namespace_annotation_fields:
namespace_labels: ""
node_annotation_fields:
node_labels: ""
# https://github.com/vectordotdev/vector/issues/12014
# https://github.com/vectordotdev/vector/issues/13467
max_line_bytes: 131072 # 128 KiB
max_read_bytes: 131072 # 128 KiB
sinks:
prom_exporter:
type: prometheus_exporter
inputs: [internal_metrics]
address: 0.0.0.0:9090
vector:
type: vector
compression: true
version: "2"
address: vector-aggregator.observability:6000
inputs: ["kubernetes_logs"]

View file

@ -0,0 +1,20 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app vector-agent
namespace: flux-system
spec:
targetNamespace: observability
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/observability/vector-agent/app
prune: true
sourceRef:
kind: GitRepository
name: theshire
wait: false
interval: 30m
retryInterval: 1m