Chrysostomos Nanakos 0c8e28fa46
feat(k8s): add Vector logging infrastructure for benchmarks
Add Vector agent/aggregator deployment for collecting logs from Codex
benchmark experiments in K8s. Includes PVC for log storage, S3 secret
template and RBAC.

Vector collects logs from benchmark pods and writes JSONL files for
post-processing by the log-parsing workflow.

Signed-off-by: Chrysostomos Nanakos <chris@include.gr>
2025-10-21 13:13:49 +03:00

113 lines
2.7 KiB
YAML

# Vector Agent DaemonSet for collecting benchmark logs
# Runs on each node to collect logs from local pods and forward to Vector Aggregator
apiVersion: v1
kind: ServiceAccount
metadata:
name: vector
namespace: argo
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: vector-agent
rules:
- apiGroups:
- ""
resources:
- namespaces
- nodes
- pods
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: vector-agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vector-agent
subjects:
- kind: ServiceAccount
name: vector
namespace: argo
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: vector
namespace: argo
labels:
app.kubernetes.io/name: vector
app.kubernetes.io/instance: vector
app.kubernetes.io/component: Agent
spec:
selector:
matchLabels:
app.kubernetes.io/name: vector
app.kubernetes.io/instance: vector
app.kubernetes.io/component: Agent
template:
metadata:
labels:
app.kubernetes.io/name: vector
app.kubernetes.io/instance: vector
app.kubernetes.io/component: Agent
spec:
serviceAccountName: vector
containers:
- name: vector
image: timberio/vector:0.34.0-distroless-libc
args:
- --config
- /etc/vector/vector.yaml
env:
- name: VECTOR_SELF_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: VECTOR_SELF_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: VECTOR_SELF_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: VECTOR_LOG
value: "info"
volumeMounts:
- name: config
mountPath: /etc/vector
readOnly: true
- name: data
mountPath: /vector-data
- name: var-log
mountPath: /var/log
readOnly: true
- name: var-lib
mountPath: /var/lib
readOnly: true
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1000m
memory: 1Gi
volumes:
- name: config
configMap:
name: vector-agent-config
- name: data
emptyDir: {}
- name: var-log
hostPath:
path: /var/log
- name: var-lib
hostPath:
path: /var/lib