Bump helm/kind-action from 1.13.0 to 1.14.0 (#338)
Bumps helm/kind-action from 1.13.0 to 1.14.0.
updated-dependencies:
- dependency-name: helm/kind-action dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
NATS Controllers for Kubernetes (NACK)
Table of Contents
JetStream Controller
The JetStream controllers allows you to manage NATS JetStream resources via Kubernetes CRDs.
Controller Modes
NACK supports two controller modes with different capabilities:
--control-loop)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
The API reference documents all available CRD fields for Streams, Consumers, KeyValue, ObjectStore, and Account resources.
Getting started
Install with Helm:
(Optional) Enable Experimental
controller-runtimeControllersManaging 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=trueto your install flags or setnamespaced: truein yourvalues.yaml. When set, the controller will only reconcile resources within its own namespace.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.
The above manifests will define two Account resources, each pulling credentials from a Kubernetes secret. Account
ais configured to use the NATS Cluster in namespacenats-aand Accountbis configured to use the NATS Cluster in namespacenats-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-aandfoo-b, must be distinct to not conflict as Kubernetes resources, but the stream names themselves are bothfoo.See more details in the 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-loopmode, set--crd-connect.If running with
--control-loop, resource-level connection config will always override any global config.Example Stream:
Creating NATS Resources
Let’s create a stream and a couple of consumers:
Now we’re ready to use Streams and Consumers. Let’s start off with writing some data into
mystream.First, we’ll read the data using a pull-based consumer.
From the above
my-pull-consumerConsumer CRD, we have set the filterSubject oforders.received. You can double check with the following command:So that’s the subject my-pull-consumer will pull messages from.
Next, let’s read data using a push-based consumer.
From the above
my-push-consumerConsumer CRD, we have set the deliverSubject ofmy-push-consumer.orders, as you can confirm with the following command:So pushed messages will arrive on that subject. This time all messages arrive automatically.
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.
The nsc 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.
You can then link an Account to a Stream so that the Stream uses the Account information for its creation.
The following is an example of how to get Accounts working with a custom NATS Server URL and TLS certificates.
After Accounts, Streams, and Consumers are created, let’s log into the nats-box container to run the management CLI.
There should now be some Streams available, verify with
natscommand.You can now publish messages on a Stream.
And pull messages from a Consumer.
Local Development
Build Docker image
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.
Configuring
Local Development
Build Docker image
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.
Configuring
Local Development
Build Docker image