github.com/argoproj/argo-events@v1.9.1/docs/eventbus/jetstream.md (about)

     1  ## Jetstream
     2  
     3  [Jetstream](https://docs.nats.io/nats-concepts/jetstream) is the latest streaming server implemented by the NATS community, with improvements from the original NATS Streaming (which will eventually be deprecated).
     4  
     5  A simplest Jetstream EventBus example:
     6  
     7  ```yaml
     8  apiVersion: argoproj.io/v1alpha1
     9  kind: EventBus
    10  metadata:
    11    name: default
    12  spec:
    13    jetstream:
    14      version: latest # Do NOT use "latest" but a specific version in your real deployment
    15  ```
    16  
    17  The example above brings up a Jetstream
    18  [StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)
    19  with 3 replicas in the namespace.
    20  
    21  ## Properties
    22  
    23  Check
    24  [here](https://github.com/argoproj/argo-events/blob/master/api/event-bus.md#argoproj.io/v1alpha1.JetstreamBus)
    25  for the full spec of `jetstream`.
    26  
    27  ### version
    28  
    29  The version number specified in the example above is the release number for the NATS server. We will support some subset of these as we've tried them out and only plan to upgrade them as needed. To take a look at what that includes:
    30  
    31  ```
    32  kubectl get configmap argo-events-controller-config -o yaml
    33  ```
    34  
    35  ### A more involved example
    36  
    37  Another example with more configuration:
    38  
    39  ```
    40  apiVersion: argoproj.io/v1alpha1
    41  kind: EventBus
    42  metadata:
    43    name: default
    44  spec:
    45    jetstream:
    46      version: latest # Do NOT use "latest" but a specific version in your real deployment
    47      replicas: 5
    48      persistence: # optional
    49          storageClassName: standard
    50          accessMode: ReadWriteOnce
    51          volumeSize: 10Gi
    52      streamConfig: |             # see default values in argo-events-controller-config
    53        maxAge: 24h
    54      settings: |
    55        max_file_store: 1GB       # see default values in argo-events-controller-config
    56      startArgs:
    57        - "-D"                    # debug-level logs
    58  ```
    59  
    60  ## Security
    61  
    62  For Jetstream, TLS is turned on for all client-server communication as well as between Jetstream nodes. In addition, for client-server communication we by default use password authentication (and because TLS is turned on, the password is encrypted).
    63  
    64  ## How it works under the hood
    65  
    66  Jetstream has the concept of a Stream, and Subjects (i.e. topics) which are used on a Stream. From the documentation: “Each Stream defines how messages are stored and what the limits (duration, size, interest) of the retention are.” For Argo Events, we have one Stream called "default" with a single set of settings, but we have multiple subjects, each of which is named `default.<eventsourcename>.<eventname>`. Sensors subscribe to the subjects they need using durable consumers.
    67  
    68  ### Exotic
    69  
    70  To use an existing JetStream service, follow the example below.
    71  
    72  ```yaml
    73  apiVersion: argoproj.io/v1alpha1
    74  kind: EventBus
    75  metadata:
    76    name: default
    77  spec:
    78    jetstreamExotic:
    79        url: nats://xxxxx:xxx
    80        accessSecret:
    81          name: my-secret-name
    82          key: secret-key
    83        streamConfig: ""
    84  ```