- Historically NATS Streaming (STAN) has been used.
- JetStream is the newer NATS offering and provides advanced streaming and durability features.
Argo Events supports two general EventBus deployment modes: a managed (native) mode where Argo Events installs and manages a NATS cluster for you, and an external mode where Argo Events connects to an existing NATS/JetStream cluster you already operate.
What the EventBus spec configures
The EventBus Custom Resource (CRD) declares whether Argo Events should:- install and manage a NATS cluster (native/managed), or
- connect to an already-running NATS/JetStream cluster (external/existing).
| Resource area | Purpose |
|---|---|
| Mode | Choose managed (native) or external (existing) |
| Replication / HA | Number of NATS replicas to run for resilience |
| Authentication | Token-based auth, TLS, or no-auth for quick tests |
| Persistence | Disk-backed storage for durable messaging (recommended for production) |
| Network / Connection | URLs, ports, TLS and secret references for external clusters |
Native (managed) example
This instructs Argo Events to create and manage a NATS Streaming or JetStream cluster for you. Typical fields set here include replica count, authentication, and persistence.- Running at least three replicas is a common high-availability pattern for production clusters.
- Persistence (disk-backed storage) prevents message loss if NATS instances restart; in-memory-only clusters can lose messages on crash/restart.
Always enable persistence and select an appropriate storageClass and size for production. If you plan to use JetStream, persistent storage is required to meet durability guarantees.
External / existing cluster example
If you already run a NATS or JetStream cluster, configure the EventBus to connect to it by supplying connection endpoints and any TLS/auth settings required.- Use this mode when you operate a centralized messaging layer shared across teams or already manage a hardened NATS/JetStream cluster.
- Ensure correct network routing, TLS certificates, and credentials so Argo Events can reliably connect to the external cluster.
Managed vs External — quick comparison
| Mode | When to use | Key considerations |
|---|---|---|
| Managed / native | Single-tenant Argo Events deployments or quick setups | Argo manages lifecycle; convenient but you’re responsible for cluster sizing, persistence, and backups |
| External / existing | When a central messaging platform is already in place | Integrate with existing security, observability, and HA practices; network & TLS must be configured |
JetStream vs NATS Streaming (STAN)
- JetStream provides modern streaming semantics, richer retention and persistence options, and improved operator features.
- STAN is legacy NATS Streaming and may be present in older Argo Events setups; check compatibility of your Argo Events version.
- Prefer JetStream for production-grade durability and advanced streaming features when supported by your Argo Events release.
Best practices
- Development / demos:
- Use native mode with minimal replicas and optional no-auth for rapid iteration.
- Persistence can be disabled for ephemeral test clusters.
- Production:
- Use native mode with at least three replicas or connect to a hardened external NATS/JetStream cluster.
- Enable persistence with an appropriate storageClass and capacity.
- Secure the cluster with TLS and token-based auth (or more advanced auth mechanisms).
- Use JetStream when you need durable message storage, advanced retention, or streaming guarantees—confirm Argo Events version support.
- Observability and operations:
- Monitor NATS instance metrics and JetStream stream state.
- Plan backups or retention policies for stored messages if they are business-critical.
Links and references
- Argo Events — Official Documentation
- NATS: JetStream documentation
- NATS Streaming (STAN) legacy docs