nats-account-server

by joaquinito2051

Helm chartv0.8.1App 1.0.0

A Helm chart for the NATS.io JWT Account Server

About this chart

NATS Account Server

A simple HTTP server to host account JWTs for nats-server 2.0 account authentication.

NATS 2.0 introduced the concept of accounts to provide secure multi-tenancy through separate subject spaces. These accounts are configured with JWTs that encapsulate the account settings. User JWTs are used to authenticate. The nats-server can be configured to use local account information or to rely on an external, HTTP-based source for account JWTs.

TL;DR;

helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm install my-nats-account-server nats/nats-account-server

Basic Configuration

accountserver:
  image: "synadia/nats-account-server:0.8.4"
  pullPolicy: IfNotPresent

Storage

store:
  type: file
  file:
    storageSize: 1Gi

NATS Connection

NATS Server connection settings.

nats:
  # NATS Service to which we can connect.
  url: "nats://nats:4222"

  # Credentials to connect to the NATS Server.
  credentials:
    secret:
      name: nats-sys-creds
      key: sys.creds

Operator

Trusted Operator mode settings.

operator:
  # Reference to the system account jwt.
  systemaccountjwt:
    configMap:
      name: nats-sys-jwt
      key: SYS.jwt
  
  # Reference to the Operator JWT.
  operatorjwt:
    configMap:
      name: operator-jwt
      key: KO.jwt

Deploy nats-account-server with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nats-account-server on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartnats-account-server is pinned at v0.8.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply