Skip to main content
Version: 1.0.0

NATS

NATS is a lightweight and high-performance messaging solution used for microservices communication, IoT, and real-time applications. This managed service facilitates the management of NATS clusters, with support for Jetstream for persistent messaging.


Configuration Example

Here is a YAML configuration example for a NATS cluster with Jetstream enabled and custom parameters:

apiVersion: apps.cozystack.io/v1alpha1
kind: NATS
metadata:
name: nats-example
spec:
external: false
replicas: 3
storageClass: "replicated"
users:
user1:
password: "strongpassword"
user2: {}
jetstream:
enabled: true
size: 20Gi
config:
merge:
server_name: "nats-example"
authorization:
token: "my-secret-token"
jetstream:
max_memory_store: 2Gi

Using the kubeconfig provided by Hikube and this example yaml, saved as a manifest.yaml file, you can easily test the application deployment using the following command:

kubectl apply -f manifest.yaml

Configurable Parameters

General Parameters

NameDescriptionDefault Value
externalAllows external access from outside the cluster.false
replicasNumber of replicas in the NATS cluster.2
storageClassStorage class used for data."replicated" or "local"

Configuration Parameters

NameDescriptionDefault Value
usersUsers configuration.{}
jetstream.sizeSize of persistent storage for Jetstream (message store).10Gi
jetstream.enabledEnables or disables Jetstream for persistent messaging.true
config.mergeAdditional configuration to merge into the NATS configuration.{}
config.resolverAdditional configuration to merge for resolution in the NATS configuration.{}

Additional Resources

To learn more about NATS and Jetstream, check the following resources: