Running NATS on K8S

In this repository you can find several examples of how to deploy NATS, NATS Streaming and other tools from the NATS ecosystem on Kubernetes.

Getting started with NATS using Helm

In this repo you can find the Helm 3 based charts to install NATS and NATS Streaming (STAN).

> helm repo add nats
> helm repo update

> helm repo list
NAME          	URL 

> helm install my-nats nats/nats
> helm install my-stan nats/stan --set stan.nats.url=nats://my-nats:4222

Quick start using the one-line installer

Another method way to quickly bootstrap a NATS is to use the following command:

curl -sSL | sh

In case you don’t have a Kubernetes cluster already, you can find some notes on how to create a small cluster using one of the hosted Kubernetes providers here. You can find more info about running NATS on Kubernetes in the docs.

This will run a nats-setup container with the required policy and deploy a NATS cluster on Kubernetes with external access, TLS and decentralized authorization.


By default, the installer will deploy the Prometheus Operator and the Cert Manager for metrics and TLS support, and the NATS instances will also bind the 4222 host port for external access.

You can customize the installer to install without TLS or without Auth to have a simpler setup as follows:

# Disable TLS
curl -sSL | sh -s -- --without-tls

# Disable Auth and TLS (also disables NATS surveyor and NATS Streaming)
curl -sSL | sh -s -- --without-tls --without-auth

Note: Since NATS Streaming will be running as a leafnode to NATS (under the STAN account) and that NATS Surveyor requires the system account to monitor events, disabling auth also means that NATS Streaming and NATS Surveyor based monitoring will be disabled.

The monitoring dashboard setup using NATS Surveyor can be accessed by using port-forward:

kubectl port-forward deployments/nats-surveyor-grafana 3000:3000

Next, open the following URL in your browser:


To cleanup the results you can run:

curl -sSL | sh


Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.