Skip to main content
Version: v1.6.0

NatsAccountRule YAML Specification

The NatsAccountRule kind defines the NATS account-level policy: connection and JetStream limits, imports/exports, and publish/subscribe allow/deny. Applications reference it via spec.natsConfig.natsRule to assign NATS account access. Microservices then use NatsUserRule names for user-level permissions within that account.

Example

apiVersion: datasance.com/v3
kind: NatsAccountRule
metadata:
name: test-export
spec:
description: Orders account
maxConnections: -1
maxSubscriptions: -1
exportsAllowWildcards: true
memStorage: -1
diskStorage: -1
streams: -1
consumer: -1
exports:
- name: orders-stream
subject: foo.>
type: stream
description: Orders event stream

Main fields

FieldDescription
metadata.nameUnique name. Use this in Application spec.natsConfig.natsRule.
spec.descriptionOptional description.
spec.maxConnections, spec.maxSubscriptionsLimits (-1 = unlimited).
spec.exports, spec.importsStream or service exports/imports for multi-account NATS.
spec.memStorage, spec.diskStorage, spec.streams, spec.consumerJetStream limits.
spec.pubAllow, spec.pubDeny, spec.subAllow, spec.subDenySubject allow/deny lists.

Deploy with potctl deploy -f nats-account-rule.yaml. For all fields, predefined rules, and REST API, see Security – NATS Account Rule.

Group 3See anything wrong with the document? Help us improve it!