[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://github.com/nats-io/nack/actions/workflows/release.yaml)
[](https://github.com/nats-io/nack/actions/workflows/e2e.yaml)
[](https://github.com/nats-io/nack/actions/workflows/test.yaml)
[NATS](https://nats.io) Controllers for Kubernetes (NACK)
## Table of Contents
- [JetStream Controller](#jetstream-controller)
- [Controller Modes](#controller-modes)
- [Getting Started](#getting-started)
- [Managing Multiple NATS Systems and Accounts](#managing-multiple-nats-systems-and-accounts)
- [Creating NATS Resources](#creating-nats-resources)
- [Getting Started with Accounts](#getting-started-with-accounts)
- [Local Development](#local-development)
- [NATS Server Config Reloader](#nats-server-config-reloader)
- [NATS Boot Config](#nats-boot-config)
## JetStream Controller
The JetStream controllers allows you to manage [NATS JetStream](https://docs.nats.io/nats-concepts/jetstream) resources via Kubernetes CRDs.
### Controller Modes
NACK supports two controller modes with different capabilities:
| Mode | Streams | Consumers | Key/Value | Object Store | Accounts |
|------|---------|-----------|-----------|--------------|----------|
| **Legacy (default)** | ✅ | ✅ | ❌ | ❌ | ❌ |
| **Control-loop** (`--control-loop`) | ✅ | ✅ | ✅ | ✅ | ✅ |
> **Important**: Key/Value stores and Object stores are **only supported in control-loop mode**. If you create KeyValue or ObjectStore resources without enabling control-loop mode, they will not be reconciled.
Resources managed by NACK controllers are expected to _exclusively_ be managed by NACK, and configuration state will be enforced if mutated by an external client.
## [API Reference](docs/api.md)
The API reference documents all available CRD fields for Streams, Consumers, KeyValue, ObjectStore, and Account resources.
### Getting started
Install with Helm:
```sh
helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm repo update
helm upgrade --install nats nats/nats \
--set config.jetstream.enabled=true \
--set config.jetstream.memoryStore.enabled=true \
--set config.cluster.enabled=true --wait
helm upgrade --install nack nats/nack \
--set jetstream.nats.url=nats://nats.default.svc.cluster.local:4222 --wait
```
#### (Optional) Enable Experimental `controller-runtime` Controllers
> **Note**: The updated controllers will more reliably enforce resource state. If migrating from an older version of NACK, as long as all NATS resources are in-sync with NACK resources no modifications are expected.
>
> The `jetstream-controller` logs will contain a diff of any changes the controller has made.
```sh
helm upgrade nack nats/nack \
--set jetstream.nats.url=nats://nats.default.svc.cluster.local:4222 \
--set jetstream.additionalArgs={--control-loop} --wait
```
### Managing Multiple NATS Systems and Accounts
There are several approaches for managing multiple NATS Systems with NACK within one Kubernetes cluster. These options are not mutually exclusive.
#### 1. Run Multiple Namespaced Controllers
You can run multiple NACK controllers on the same Kubernetes cluster. Add `--set config.namespaced=true` to your install flags or set `namespaced: true` in your `values.yaml`. When set, the controller will only reconcile resources within its own namespace.
```sh
helm upgrade --install nack nats/nack \
--create-namespace --namespace nats \
--set namespaced=true \
--set jetstream.nats.url=nats://nats.nats.svc.cluster.local:4222 --wait
```
#### 2. Use the Accounts Resource
The Accounts resource acts as a connection config for other resources. You may define multiple accounts for the same, or for distinct, NATS Systems.
```yaml
---
apiVersion: jetstream.nats.io/v1beta2
kind: Account
metadata:
name: a
spec:
name: a
creds:
secret:
name: account-a-creds
servers:
- nats://nats.nats-a.svc.cluster.local
---
apiVersion: jetstream.nats.io/v1beta2
kind: Account
metadata:
name: b
spec:
name: b
creds:
secret:
name: account-b-creds
servers:
- nats://nats.nats-b.svc.cluster.local
---
apiVersion: jetstream.nats.io/v1beta2
kind: Stream
metadata:
name: foo-a
spec:
name: foo
subjects: ["foo", "foo.>"]
storage: file
replicas: 3
maxAge: 1h
account: a
---
apiVersion: jetstream.nats.io/v1beta2
kind: Stream
metadata:
name: foo-b
spec:
name: foo
subjects: ["foo", "foo.>"]
storage: file
replicas: 3
maxAge: 1h
account: b
```
The above manifests will define two Account resources, each pulling credentials from a Kubernetes secret. Account `a` is configured to use the NATS Cluster in namespace `nats-a` and Account `b` is configured to use the NATS Cluster in namespace `nats-b`. The NATS clusters do not need to be in Kubernetes, this is just an example.
This will also create an identical stream, `foo`, in each cluster. **Note:** The resource names, `foo-a` and `foo-b`, must be distinct to not conflict as Kubernetes resources, but the stream names themselves are both `foo`.
See more details in the [Getting Started with Accounts](#getting-started-with-accounts) section.
#### 3. Define Connection Config in the CRD Manifest
You may define some connection options within the resource manifests directly. If not running in the newer `--control-loop` mode, set `--crd-connect`.
If running with `--control-loop`, resource-level connection config will always override any global config.
> **Note**: The `--crd-connect` flag is not required if running with `--control-loop`.
```sh
helm upgrade nack nats/nack \
--set jetstream.additionalArgs={--crd-connect} --wait
```
#### Example Stream:
```yaml
apiVersion: jetstream.nats.io/v1beta2
kind: Stream
metadata:
name: bar
spec:
name: bar
subjects: ["bar", "bar.>"]
storage: file
replicas: 3
maxAge: 1h
servers:
- nats://nats.nats.svc.cluster.local:4222
```
### Creating NATS Resources
Let's create a stream and a couple of consumers:
```yaml
---
apiVersion: jetstream.nats.io/v1beta2
kind: Stream
metadata:
name: mystream
spec:
name: mystream
subjects: ["orders.*"]
storage: memory
maxAge: 1h
---
apiVersion: jetstream.nats.io/v1beta2
kind: Consumer
metadata:
name: my-push-consumer
spec:
streamName: mystream
durableName: my-push-consumer
deliverSubject: my-push-consumer.orders
deliverPolicy: last
ackPolicy: none
replayPolicy: instant
---
apiVersion: jetstream.nats.io/v1beta2
kind: Consumer
metadata:
name: my-pull-consumer
spec:
streamName: mystream
durableName: my-pull-consumer
deliverPolicy: all
filterSubject: orders.received
maxDeliver: 20
ackPolicy: explicit
---
# Note: KeyValue requires control-loop mode to be enabled
apiVersion: jetstream.nats.io/v1beta2
kind: KeyValue
metadata:
name: my-key-value
spec:
bucket: my-key-value
history: 20
storage: file
maxBytes: 2048
compression: true
---
# Note: ObjectStore requires control-loop mode to be enabled
apiVersion: jetstream.nats.io/v1beta2
kind: ObjectStore
metadata:
name: my-object-store
spec:
bucket: my-object-store
storage: file
replicas: 1
maxBytes: 536870912 # 512 MB
compression: true
```
```sh
# Create a stream.
$ kubectl apply -f https://raw.githubusercontent.com/nats-io/nack/main/deploy/examples/stream.yml
# Check if it was successfully created.
$ kubectl get streams
NAME STATE STREAM NAME SUBJECTS
mystream Ready mystream [orders.*]
# Create a push-based consumer
$ kubectl apply -f https://raw.githubusercontent.com/nats-io/nack/main/deploy/examples/consumer_push.yml
# Create a pull based consumer
$ kubectl apply -f https://raw.githubusercontent.com/nats-io/nack/main/deploy/examples/consumer_pull.yml
# Check if they were successfully created.
$ kubectl get consumers
NAME STATE STREAM CONSUMER ACK POLICY
my-pull-consumer Ready mystream my-pull-consumer explicit
my-push-consumer Ready mystream my-push-consumer none
# If you end up in an Errored state, run kubectl describe for more info.
# kubectl describe streams mystream
# kubectl describe consumers my-pull-consumer
```
Now we're ready to use Streams and Consumers. Let's start off with writing some
data into `mystream`.
```sh
# Run nats-box that includes the NATS management utilities, and exec into it.
$ kubectl exec -it deployment/nats-box -- /bin/sh -l
# Publish a couple of messages from nats-box
nats-box:~$ nats pub orders.received "order 1"
nats-box:~$ nats pub orders.received "order 2"
```
First, we'll read the data using a pull-based consumer.
From the above `my-pull-consumer` Consumer CRD, we have set the filterSubject
of `orders.received`. You can double check with the following command:
```sh
$ kubectl get consumer my-pull-consumer -o jsonpath={.spec.filterSubject}
orders.received
```
So that's the subject my-pull-consumer will pull messages from.
```sh
# Pull first message.
nats-box:~$ nats consumer next mystream my-pull-consumer
--- subject: orders.received / delivered: 1 / stream seq: 1 / consumer seq: 1
order 1
Acknowledged message
# Pull next message.
nats-box:~$ nats consumer next mystream my-pull-consumer
--- subject: orders.received / delivered: 1 / stream seq: 2 / consumer seq: 2
order 2
Acknowledged message
```
Next, let's read data using a push-based consumer.
From the above `my-push-consumer` Consumer CRD, we have set the deliverSubject
of `my-push-consumer.orders`, as you can confirm with the following command:
```sh
$ kubectl get consumer my-push-consumer -o jsonpath={.spec.deliverSubject}
my-push-consumer.orders
```
So pushed messages will arrive on that subject. This time all messages arrive automatically.
```sh
nats-box:~$ nats sub my-push-consumer.orders
17:57:24 Subscribing on my-push-consumer.orders
[#1] Received JetStream message: consumer: mystream > my-push-consumer / subject: orders.received /
delivered: 1 / consumer seq: 1 / stream seq: 1 / ack: false
order 1
[#2] Received JetStream message: consumer: mystream > my-push-consumer / subject: orders.received /
delivered: 1 / consumer seq: 2 / stream seq: 2 / ack: false
order 2
```
### Getting Started with Accounts
You can create an Account resource with the following CRD. The Account resource
can be used to specify server and TLS information.
> **Note** The `Account` resource does not create or manage NATS accounts. It functions as a connection and authentication config for the managed resources.
The [nsc](https://docs.nats.io/using-nats/nats-tools/nsc/basics#creating-an-operator-account-and-user) tool can be used to manage your NATS account configuration on the server-side. You can find more details about NATS decentralized auth in the [docs](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt).
```yaml
---
apiVersion: jetstream.nats.io/v1beta2
kind: Account
metadata:
name: a
spec:
name: a
servers:
- nats://nats:4222
tls:
secret:
name: nack-a-tls
ca: "ca.crt"
cert: "tls.crt"
key: "tls.key"
```
You can then link an Account to a Stream so that the Stream uses the Account
information for its creation.
```yaml
---
apiVersion: jetstream.nats.io/v1beta2
kind: Stream
metadata:
name: foo
spec:
name: foo
subjects: ["foo", "foo.>"]
storage: file
replicas: 1
account: a # <-- Create stream using account A information
```
The following is an example of how to get Accounts working with a custom NATS
Server URL and TLS certificates.
```sh
# Install cert-manager
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.17.0/cert-manager.yaml
# Install TLS certs
cd examples/secure
# Install certificate issuer
kubectl apply -f issuer.yaml
# Install account A cert
kubectl apply -f nack-a-client-tls.yaml
# Install server cert
kubectl apply -f server-tls.yaml
# Install nats-box cert
kubectl apply -f client-tls.yaml
# Install NATS cluster
helm upgrade --install -f nats-helm.yaml nats nats/nats
# Verify pods are healthy
kubectl get pods
# Install JetStream Controller from nack
helm upgrade --install nack nats/nack --set jetstream.enabled=true
# Verify pods are healthy
kubectl get pods
# Create account A resource
kubectl apply -f nack/nats-account-a.yaml
# Create stream using account A
kubectl apply -f nack/nats-stream-foo-a.yaml
# Create consumer using account A
kubectl apply -f nack/nats-consumer-bar-a.yaml
```
After Accounts, Streams, and Consumers are created, let's log into the nats-box
container to run the management CLI.
```sh
# Get container shell
kubectl exec -it deployment/nats-box -- /bin/sh -l
```
There should now be some Streams available, verify with `nats` command.
```sh
# List streams
nats stream ls
```
You can now publish messages on a Stream.
```sh
# Push message
nats pub foo hi
```
And pull messages from a Consumer.
```sh
# Pull message
nats consumer next foo bar
```
### Local Development
```sh
# First, build the jetstream controller.
make jetstream-controller
# Next, run the controller like this
./jetstream-controller -kubeconfig ~/.kube/config -s nats://localhost:4222
# Pro tip: jetstream-controller uses klog just like kubectl or kube-apiserver.
# This means you can change the verbosity of logs with the -v flag.
#
# For example, this prints raw HTTP requests and responses.
# ./jetstream-controller -v=10
# You'll probably want to start a local Jetstream-enabled NATS server, unless
# you use a public one.
nats-server -DV -js
```
Build Docker image
```sh
make jetstream-controller-docker ver=1.2.3
```
## NATS Server Config Reloader
This is a sidecar that you can use to automatically reload your NATS Server
configuration file.
### Installing with Helm
For more information see the
[Chart repo](https://github.com/nats-io/k8s/tree/main/helm/charts/nats).
```sh
helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm upgrade --install nats nats/nats
```
### Configuring
```yaml
reloader:
enabled: true
image: natsio/nats-server-config-reloader:0.16.1
pullPolicy: IfNotPresent
```
### Local Development
```sh
# First, build the config reloader.
make nats-server-config-reloader
# Next, run the reloader like this
./nats-server-config-reloader
```
Build Docker image
```sh
make nats-server-config-reloader-docker ver=1.2.3
```
## NATS Boot Config
A helper utility used during NATS server pod initialization to generate and manage boot-time configuration.
### Installing with Helm
For more information see the
[Chart repo](https://github.com/nats-io/k8s/tree/main/helm/charts/nats).
```sh
helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm upgrade --install nats nats/nats
```
### Configuring
```yaml
bootconfig:
image: natsio/nats-boot-config:0.16.1
pullPolicy: IfNotPresent
```
### Local Development
```sh
# First, build the project.
make nats-boot-config
# Next, run the project like this
./nats-boot-config
```
Build Docker image
```sh
make nats-boot-config-docker ver=1.2.3
```
================================================
FILE: cicd/Dockerfile
================================================
#syntax=docker/dockerfile:1.13
ARG GO_APP
FROM alpine:3.23.3 AS deps
ARG GO_APP
ARG GORELEASER_DIST_DIR=/go/src/dist
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
RUN mkdir -p /go/bin /go/src ${GORELEASER_DIST_DIR}
COPY --from=build ${GORELEASER_DIST_DIR}/ ${GORELEASER_DIST_DIR}
RUN <| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta2 | true |
| kind | string | Stream | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| account | string |
Name of the account to which the Stream belongs. |
false |
| allowDirect | boolean |
When true, allow higher performance, direct access to get individual messages. Default: false |
false |
| allowRollup | boolean |
When true, allows the use of the Nats-Rollup header to replace all contents of a stream, or subject in a stream, with a single new message. Default: false |
false |
| compression | enum |
Stream specific compression. Enum: s2, none, Default: |
false |
| consumerLimits | object |
|
false |
| creds | string |
NATS user credentials for connecting to servers. Please make sure your controller has mounted the creds on this path. Default: |
false |
| denyDelete | boolean |
When true, restricts the ability to delete messages from a stream via the API. Cannot be changed once set to true. Default: false |
false |
| denyPurge | boolean |
When true, restricts the ability to purge a stream via the API. Cannot be changed once set to true. Default: false |
false |
| description | string |
The description of the stream. |
false |
| discard | enum |
When a Stream reach it's limits either old messages are deleted or new ones are denied. Enum: old, new Default: old |
false |
| discardPerSubject | boolean |
Applies discard policy on a per-subject basis. Requires discard policy 'new' and 'maxMsgs' to be set. Default: false |
false |
| duplicateWindow | string |
The duration window to track duplicate messages for. |
false |
| firstSequence | number |
Sequence number from which the Stream will start. Default: 0 |
false |
| maxAge | string |
Maximum age of any message in the stream, expressed in Go's time.Duration format. Empty for unlimited. Default: |
false |
| maxBytes | integer |
How big the Stream may be, when the combined stream size exceeds this old messages are removed. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxConsumers | integer |
How many Consumers can be defined for a given Stream. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgSize | integer |
The largest message that will be accepted by the Stream. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgs | integer |
How many messages may be in a Stream, oldest messages will be removed if the Stream exceeds this size. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgsPerSubject | integer |
The maximum number of messages per subject. Default: 0 |
false |
| allowMsgTtl | boolean |
When true, allows header initiated per-message TTLs. If disabled, then the `NATS-TTL` header will be ignored. Default: false |
false |
| subjectDeleteMarkerTtl | string |
Enables and sets a duration for adding server markers for delete, purge and max age limits, expressed in Go's time.Duration format. |
false |
| metadata | map[string]string |
Additional Stream metadata. |
false |
| mirror | object |
A stream mirror. |
false |
| mirrorDirect | boolean |
When true, enables direct access to messages from the origin stream. Default: false |
false |
| name | string |
A unique name for the Stream. |
false |
| nkey | string |
NATS user NKey for connecting to servers. Default: |
false |
| noAck | boolean |
Disables acknowledging messages that are received by the Stream. Default: false |
false |
| placement | object |
A stream's placement. |
false |
| preventDelete | boolean |
When true, the managed Stream will not be deleted when the resource is deleted. Default: false |
false |
| preventUpdate | boolean |
When true, the managed Stream will not be updated when the resource is updated. Default: false |
false |
| replicas | integer |
How many replicas to keep for each message. Default: 1 Minimum: 1 |
false |
| republish | object |
Republish configuration of the stream. |
false |
| retention | enum |
How messages are retained in the Stream, once this is exceeded old messages are removed. Enum: limits, interest, workqueue Default: limits |
false |
| sealed | boolean |
Seal an existing stream so no new messages may be added. Default: false |
false |
| servers | []string |
A list of servers for creating stream. Default: [] |
false |
| sources | []object |
A stream's sources. |
false |
| storage | enum |
The storage backend to use for the Stream. Enum: file, memory Default: memory |
false |
| subjectTransform | object |
SubjectTransform is for applying a subject transform (to matching messages) when a new message is received. |
false |
| subjects | []string |
A list of subjects to consume, supports wildcards. |
false |
| tls | object |
A client's TLS certs and keys. |
false |
| tlsFirst | boolean |
When true, the KV Store will initiate TLS before server INFO. Default: false |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| inactiveThreshold | string |
The duration of inactivity after which a consumer is considered inactive. |
false |
| maxAckPending | integer |
Maximum number of outstanding unacknowledged messages. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| externalApiPrefix | string |
|
false |
| externalDeliverPrefix | string |
|
false |
| filterSubject | string |
|
false |
| name | string |
|
false |
| optStartSeq | integer |
|
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| subjectTransforms | []object |
List of subject transforms for this mirror. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| dest | string |
Destination subject. |
false |
| source | string |
Source subject. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| cluster | string |
|
false |
| tags | []string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| destination | string |
Messages will be additionally published to this subject. |
false |
| source | string |
Messages will be published from this subject to the destination subject. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| externalApiPrefix | string |
|
false |
| externalDeliverPrefix | string |
|
false |
| filterSubject | string |
|
false |
| name | string |
|
false |
| optStartSeq | integer |
|
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| subjectTransforms | []object |
List of subject transforms for this mirror. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| dest | string |
Destination subject. |
false |
| source | string |
Source subject. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| dest | string |
Destination subject to transform into. |
false |
| source | string |
Source subject. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| clientCert | string |
A client's cert filepath. Should be mounted. |
false |
| clientKey | string |
A client's key filepath. Should be mounted. |
false |
| rootCas | []string |
A list of filepaths to CAs. Should be mounted. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta2 | true |
| kind | string | Consumer | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| account | string |
Name of the account to which the Consumer belongs. |
false |
| ackPolicy | enum |
How messages should be acknowledged. Enum: none, all, explicit Default: none |
false |
| ackWait | string |
How long to allow messages to remain un-acknowledged before attempting redelivery. Default: 1ns |
false |
| backoff | []string |
List of durations representing a retry time scale for NaK'd or retried messages. |
false |
| creds | string |
NATS user credentials for connecting to servers. Please make sure your controller has mounted the creds on its path. Default: |
false |
| deliverGroup | string |
The name of a queue group. |
false |
| deliverPolicy | enum |
Enum: all, last, new, byStartSequence, byStartTime Default: all |
false |
| deliverSubject | string |
The subject to deliver observed messages, when not set, a pull-based Consumer is created. |
false |
| description | string |
The description of the consumer. |
false |
| durableName | string |
The name of the Consumer. |
false |
| filterSubject | string |
Select only a specific incoming subjects, supports wildcards. |
false |
| filterSubjects | []string |
List of incoming subjects, supports wildcards. Available since 2.10. |
false |
| flowControl | boolean |
Enables flow control. Default: false |
false |
| headersOnly | boolean |
When set, only the headers of messages in the stream are delivered, and not the bodies. Additionally, Nats-Msg-Size header is added to indicate the size of the removed payload. Default: false |
false |
| heartbeatInterval | string |
The interval used to deliver idle heartbeats for push-based consumers, in Go's time.Duration format. |
false |
| inactiveThreshold | string |
The idle time an Ephemeral Consumer allows before it is removed. |
false |
| maxAckPending | integer |
Maximum pending Acks before consumers are paused. |
false |
| maxDeliver | integer |
Minimum: -1 |
false |
| maxRequestBatch | integer |
The largest batch property that may be specified when doing a pull on a Pull Consumer. |
false |
| maxRequestExpires | string |
The maximum expires duration that may be set when doing a pull on a Pull Consumer. |
false |
| maxRequestMaxBytes | integer |
The maximum max_bytes value that maybe set when dong a pull on a Pull Consumer. |
false |
| maxWaiting | integer |
The number of pulls that can be outstanding on a pull consumer, pulls received after this is reached are ignored. |
false |
| memStorage | boolean |
Force the consumer state to be kept in memory rather than inherit the setting from the stream. Default: false |
false |
| metadata | map[string]string |
Additional Consumer metadata. |
false |
| nkey | string |
NATS user NKey for connecting to servers. Default: |
false |
| optStartSeq | integer |
Minimum: 0 |
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| preventDelete | boolean |
When true, the managed Consumer will not be deleted when the resource is deleted. Default: false |
false |
| preventUpdate | boolean |
When true, the managed Consumer will not be updated when the resource is updated. Default: false |
false |
| rateLimitBps | integer |
Rate at which messages will be delivered to clients, expressed in bit per second. |
false |
| replayPolicy | enum |
How messages are sent. Enum: instant, original Default: instant |
false |
| replicas | integer |
When set do not inherit the replica count from the stream but specifically set it to this amount. |
false |
| sampleFreq | string |
What percentage of acknowledgements should be samples for observability. |
false |
| servers | []string |
A list of servers for creating consumer. Default: [] |
false |
| streamName | string |
The name of the Stream to create the Consumer in. |
false |
| tls | object |
A client's TLS certs and keys. |
false |
| tlsFirst | boolean |
When true, the KV Store will initiate TLS before server INFO. Default: false |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| clientCert | string |
A client's cert filepath. Should be mounted. |
false |
| clientKey | string |
A client's key filepath. Should be mounted. |
false |
| rootCas | []string |
A list of filepaths to CAs. Should be mounted. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta2 | true |
| kind | string | Account | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| creds | object |
The creds to be used to connect to the NATS Service. |
false |
| name | string |
A unique name for the Account. |
false |
| servers | []string |
A list of servers to connect. |
false |
| tls | object |
The TLS certs to be used to connect to the NATS Service. |
false |
| tlsFirst | boolean |
When true, the KV Store will initiate TLS before server INFO. Default: false |
false |
| token | object |
The token to be used to connect to the NATS Service. |
false |
| user | object |
The user and password to be used to connect to the NATS Service. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| file | string |
Credentials file, generated with github.com/nats-io/nsc tool. |
false |
| secret | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| name | string |
Name of the secret with the creds. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| ca | string |
Filename of the Root CA of the TLS cert. |
false |
| cert | string |
Filename of the TLS cert. |
false |
| key | string |
Filename of the TLS cert key. |
false |
| secret | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| name | string |
Name of the TLS secret with the certs. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| secret | object |
|
false |
| token | string |
Key in the secret that contains the token. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| name | string |
Name of the secret with the token. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| password | string |
Key in the secret that contains the password. |
false |
| secret | object |
|
false |
| user | string |
Key in the secret that contains the user. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| name | string |
Name of the secret with the user and password. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta2 | true |
| kind | string | KeyValue | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| account | string |
Name of the account to which the Stream belongs. |
false |
| bucket | string |
A unique name for the KV Store. |
false |
| compression | boolean |
KV Store compression. |
false |
| creds | string |
NATS user credentials for connecting to servers. Please make sure your controller has mounted the creds on its path. Default: |
false |
| description | string |
The description of the KV Store. |
false |
| history | integer |
The number of historical values to keep per key. |
false |
| maxBytes | integer |
The maximum size of the KV Store in bytes. |
false |
| maxValueSize | integer |
The maximum size of a value in bytes. |
false |
| mirror | object |
A KV Store mirror. |
false |
| nkey | string |
NATS user NKey for connecting to servers. Default: |
false |
| placement | object |
The KV Store placement via tags or cluster name. |
false |
| preventDelete | boolean |
When true, the managed KV Store will not be deleted when the resource is deleted. Default: false |
false |
| preventUpdate | boolean |
When true, the managed KV Store will not be updated when the resource is updated. Default: false |
false |
| replicas | integer |
The number of replicas to keep for the KV Store in clustered JetStream. Default: 1 Minimum: 1 Maximum: 5 |
false |
| republish | object |
Republish configuration for the KV Store. |
false |
| servers | []string |
A list of servers for creating the KV Store. Default: [] |
false |
| sources | []object |
A KV Store's sources. |
false |
| storage | enum |
The storage backend to use for the KV Store. Enum: file, memory |
false |
| tls | object |
A client's TLS certs and keys. |
false |
| tlsFirst | boolean |
When true, the KV Store will initiate TLS before server INFO. Default: false |
false |
| ttl | string |
The time expiry for keys. |
false |
| limitMarkerTtl | integer |
How long the bucket keeps markers when keys are removed by the TTL setting, 0 meaning markers are not supported |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| externalApiPrefix | string |
|
false |
| externalDeliverPrefix | string |
|
false |
| filterSubject | string |
|
false |
| name | string |
|
false |
| optStartSeq | integer |
|
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| subjectTransforms | []object |
List of subject transforms for this mirror. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| dest | string |
Destination subject. |
false |
| source | string |
Source subject. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| cluster | string |
|
false |
| tags | []string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| destination | string |
Messages will be additionally published to this subject after Bucket. |
false |
| source | string |
Messages will be published from this subject to the destination subject. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| externalApiPrefix | string |
|
false |
| externalDeliverPrefix | string |
|
false |
| filterSubject | string |
|
false |
| name | string |
|
false |
| optStartSeq | integer |
|
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| subjectTransforms | []object |
List of subject transforms for this mirror. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| dest | string |
Destination subject. |
false |
| source | string |
Source subject. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| clientCert | string |
A client's cert filepath. Should be mounted. |
false |
| clientKey | string |
A client's key filepath. Should be mounted. |
false |
| rootCas | []string |
A list of filepaths to CAs. Should be mounted. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta2 | true |
| kind | string | ObjectStore | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| account | string |
Name of the account to which the Object Store belongs. |
false |
| bucket | string |
A unique name for the Object Store. |
false |
| compression | boolean |
Object Store compression. |
false |
| creds | string |
NATS user credentials for connecting to servers. Please make sure your controller has mounted the creds on its path. Default: |
false |
| description | string |
The description of the Object Store. |
false |
| maxBytes | integer |
The maximum size of the Store in bytes. |
false |
| metadata | map[string]string |
Additional Object Store metadata. |
false |
| nkey | string |
NATS user NKey for connecting to servers. Default: |
false |
| placement | object |
The Object Store placement via tags or cluster name. |
false |
| preventDelete | boolean |
When true, the managed Object Store will not be deleted when the resource is deleted. Default: false |
false |
| preventUpdate | boolean |
When true, the managed Object Store will not be updated when the resource is updated. Default: false |
false |
| replicas | integer |
The number of replicas to keep for the Object Store in clustered JetStream. Default: 1 Minimum: 1 Maximum: 5 |
false |
| servers | []string |
A list of servers for creating the Object Store. Default: [] |
false |
| storage | enum |
The storage backend to use for the Object Store. Enum: file, memory |
false |
| tls | object |
A client's TLS certs and keys. |
false |
| tlsFirst | boolean |
When true, the KV Store will initiate TLS before server INFO. Default: false |
false |
| ttl | string |
The time expiry for keys. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| cluster | string |
|
false |
| tags | []string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| clientCert | string |
A client's cert filepath. Should be mounted. |
false |
| clientKey | string |
A client's key filepath. Should be mounted. |
false |
| rootCas | []string |
A list of filepaths to CAs. Should be mounted. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta1 | true |
| kind | string | Stream | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| description | string |
The description of the stream. |
false |
| discard | enum |
When a Stream reach it's limits either old messages are deleted or new ones are denied. Enum: old, new Default: old |
false |
| duplicateWindow | string |
The duration window to track duplicate messages for. |
false |
| maxAge | string |
Maximum age of any message in the stream, expressed in Go's time.Duration format. Empty for unlimited. Default: |
false |
| maxBytes | integer |
How big the Stream may be, when the combined stream size exceeds this old messages are removed. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxConsumers | integer |
How many Consumers can be defined for a given Stream. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgSize | integer |
The largest message that will be accepted by the Stream. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgs | integer |
How many messages may be in a Stream, oldest messages will be removed if the Stream exceeds this size. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgsPerSubject | integer |
The maximum number of messages per subject. Default: 0 |
false |
| mirror | object |
A stream mirror. |
false |
| name | string |
A unique name for the Stream. |
false |
| noAck | boolean |
Disables acknowledging messages that are received by the Stream. Default: false |
false |
| placement | object |
A stream's placement. |
false |
| replicas | integer |
How many replicas to keep for each message. Default: 1 Minimum: 1 |
false |
| retention | enum |
How messages are retained in the Stream, once this is exceeded old messages are removed. Enum: limits, interest, workqueue Default: limits |
false |
| sources | []object |
A stream's sources. |
false |
| storage | enum |
The storage backend to use for the Stream. Enum: file, memory Default: memory |
false |
| subjects | []string |
A list of subjects to consume, supports wildcards. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| externalApiPrefix | string |
|
false |
| externalDeliverPrefix | string |
|
false |
| filterSubject | string |
|
false |
| name | string |
|
false |
| optStartSeq | integer |
|
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| cluster | string |
|
false |
| tags | []string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| externalApiPrefix | string |
|
false |
| externalDeliverPrefix | string |
|
false |
| filterSubject | string |
|
false |
| name | string |
|
false |
| optStartSeq | integer |
|
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta1 | true |
| kind | string | Consumer | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| ackPolicy | enum |
How messages should be acknowledged. Enum: none, all, explicit Default: none |
false |
| ackWait | string |
How long to allow messages to remain un-acknowledged before attempting redelivery. Default: 1ns |
false |
| deliverGroup | string |
The name of a queue group. |
false |
| deliverPolicy | enum |
Enum: all, last, new, byStartSequence, byStartTime Default: all |
false |
| deliverSubject | string |
The subject to deliver observed messages, when not set, a pull-based Consumer is created. |
false |
| description | string |
The description of the consumer. |
false |
| durableName | string |
The name of the Consumer. |
false |
| filterSubject | string |
Select only a specific incoming subjects, supports wildcards. |
false |
| flowControl | boolean |
Enables flow control. Default: false |
false |
| heartbeatInterval | string |
The interval used to deliver idle heartbeats for push-based consumers, in Go's time.Duration format. |
false |
| maxAckPending | integer |
Maximum pending Acks before consumers are paused. |
false |
| maxDeliver | integer |
Minimum: -1 |
false |
| optStartSeq | integer |
Minimum: 0 |
false |
| optStartTime | string |
Time format must be RFC3339. |
false |
| rateLimitBps | integer |
Rate at which messages will be delivered to clients, expressed in bit per second. |
false |
| replayPolicy | enum |
How messages are sent. Enum: instant, original Default: instant |
false |
| sampleFreq | string |
What percentage of acknowledgements should be samples for observability. |
false |
| streamName | string |
The name of the Stream to create the Consumer in. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | jetstream.nats.io/v1beta1 | true |
| kind | string | StreamTemplate | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the `metadata` field. | true |
| spec | object |
|
false |
| status | object |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| discard | enum |
When a Stream reach it's limits either old messages are deleted or new ones are denied. Enum: old, new Default: old |
false |
| duplicateWindow | string |
The duration window to track duplicate messages for. |
false |
| maxAge | string |
Maximum age of any message in the stream, expressed in Go's time.Duration format. Empty for unlimited. Default: |
false |
| maxBytes | integer |
How big the Stream may be, when the combined stream size exceeds this old messages are removed. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxConsumers | integer |
How many Consumers can be defined for a given Stream. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgSize | integer |
The largest message that will be accepted by the Stream. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxMsgs | integer |
How many messages may be in a Stream, oldest messages will be removed if the Stream exceeds this size. -1 for unlimited. Default: -1 Minimum: -1 |
false |
| maxStreams | integer |
The maximum number of Streams this Template can create, -1 for unlimited. Default: -1 Minimum: -1 |
false |
| name | string |
A unique name for the Stream Template. |
false |
| noAck | boolean |
Disables acknowledging messages that are received by the Stream. Default: false |
false |
| replicas | integer |
How many replicas to keep for each message. Default: 1 Minimum: 1 |
false |
| retention | enum |
How messages are retained in the Stream, once this is exceeded old messages are removed. Enum: limits, interest, workqueue Default: limits |
false |
| storage | enum |
The storage backend to use for the Stream. Enum: file, memory Default: memory |
false |
| subjects | []string |
A list of subjects to consume, supports wildcards. |
false |
| Name | Type | Description | Required |
|---|---|---|---|
| conditions | []object |
|
false |
| observedGeneration | integer |
|
false |
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string |
|
false |
| message | string |
|
false |
| reason | string |
|
false |
| status | string |
|
false |
| type | string |
|
false |