File tree Expand file tree Collapse file tree 3 files changed +54
-54
lines changed
config/components/nats-streams Expand file tree Collapse file tree 3 files changed +54
-54
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ kind: Kustomization
44namespace : nats-system
55
66resources :
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/
Original file line number Diff line number Diff line change 11apiVersion : jetstream.nats.io/v1beta2
22kind : 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
356metadata :
457 name : reindex-events
558 namespace : nats-system
You can’t perform that action at this time.
0 commit comments