Skip to content

Commit

Permalink
Add vector sidecar to read cilium flow data
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroPower committed Jun 21, 2024
1 parent 19af971 commit 33017fd
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions applications/base/cilium/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

local policies = import 'policies/main.libsonnet';
local ingress = import 'ingress.libsonnet';
local vectorSidecar = std.parseYaml(importstr 'vector-sidecar.yaml');
local dashboards = std.parseYaml(importstr 'dashboards.yaml');

policies
+ ingress
+ vectorSidecar
+ dashboards
28 changes: 28 additions & 0 deletions applications/base/cilium/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/cilium/cilium/main/install/kubernetes/cilium/values.schema.json
# https://artifacthub.io/packages/helm/cilium/cilium

k8sServiceHost: kube.home.macro.network
Expand Down Expand Up @@ -89,13 +90,40 @@ encryption:
##
bpfClockProbe: false

extraContainers:
- name: vector
image: timberio/vector:0.39.0-distroless-libc
args:
- --config-dir
- &vectorConfigDir /etc/vector/
ports:
- name: vector
containerPort: 8686
- name: metrics
containerPort: 9090
volumeMounts:
- name: log-data
mountPath: /var/log
- name: vector-data
mountPath: /vector-data-dir
- name: vector-config
mountPath: *vectorConfigDir
readOnly: true

extraVolumeMounts:
- name: log-data
mountPath: /var/log

extraVolumes:
- name: log-data
emptyDir: {}
- name: vector-data
emptyDir: {}
- name: vector-config
projected:
sources:
- configMap:
name: vector-sidecar-config

# -- Grafana dashboards for cilium-agent
dashboards: &dashboards
Expand Down
29 changes: 29 additions & 0 deletions applications/base/cilium/vector-sidecar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: vector-sidecar-config
data:
vector.yaml: |
data_dir: /vector-data-dir
api:
enabled: true
address: 0.0.0.0:8686
sources:
log_files:
type: file
include:
- /var/log/**/*.log
vector_metrics:
type: internal_metrics
sinks:
vector_aggregator:
type: vector
inputs:
- log_files
address: vector-aggregator.vector.svc.cluster.local:6010
prom_exporter:
type: prometheus_exporter
inputs:
- vector_metrics
address: 0.0.0.0:9090

0 comments on commit 33017fd

Please sign in to comment.