Skip to content

Commit eb619bd

Browse files
committed
chore: consolidate streams configurations in one manifest
1 parent 82d4e2e commit eb619bd

File tree

3 files changed

+54
-54
lines changed

3 files changed

+54
-54
lines changed

config/components/nats-streams/audit-stream.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

config/components/nats-streams/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ kind: Kustomization
44
namespace: nats-system
55

66
resources:
7-
- audit-stream.yaml
8-
- reindex-stream.yaml
7+
- nats-streams.yaml
98

109
# Note: This contains application-specific NATS JetStream stream configurations.
1110
# The NATS infrastructure (server + NACK controller) is deployed from config/dependencies/nats/

config/components/nats-streams/reindex-stream.yaml renamed to config/components/nats-streams/nats-streams.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
apiVersion: jetstream.nats.io/v1beta2
22
kind: Stream
3+
metadata:
4+
name: audit-events
5+
namespace: nats-system
6+
spec:
7+
# Stream name in NATS
8+
name: AUDIT_EVENTS
9+
10+
# Subjects to consume - wildcard for all Kubernetes audit events
11+
subjects:
12+
- audit.k8s.>
13+
14+
# Retention policy: limits-based (time + size)
15+
retention: limits
16+
17+
# Storage: file-based for durability
18+
storage: file
19+
20+
# Maximum age: 7 days retention as per architecture
21+
maxAge: 168h # 7 days = 168 hours
22+
23+
# Maximum bytes: 10GB as per architecture
24+
maxBytes: 10737418240 # 10 * 1024 * 1024 * 1024
25+
26+
# Number of replicas for high availability
27+
replicas: 1 # Can be increased to 3 for production HA
28+
29+
# Discard policy when limits are reached
30+
discard: old
31+
32+
# Allow direct access for queries
33+
allowDirect: true
34+
35+
# Deduplication window - prevents duplicate messages
36+
# Extended to 10 minutes to handle webhook retries with exponential backoff
37+
# and Vector restarts. NATS uses message IDs (set to Kubernetes auditID) to
38+
# detect duplicates within this window, providing pipeline-level de-duplication
39+
# before events reach ClickHouse.
40+
duplicateWindow: 10m
41+
42+
# Maximum number of consumers
43+
maxConsumers: 10
44+
45+
# Maximum message size (10MB - large enough for batch audit events)
46+
maxMsgSize: 10485760 # 10 * 1024 * 1024
47+
48+
# No message limit - rely on age and size limits
49+
maxMsgs: -1
50+
51+
# Performance tuning
52+
noAck: false # Require acknowledgments for durability
53+
---
54+
apiVersion: jetstream.nats.io/v1beta2
55+
kind: Stream
356
metadata:
457
name: reindex-events
558
namespace: nats-system

0 commit comments

Comments
 (0)