Skip to main content

NATS


Installation

helm repo add nats https://nats-io.github.io/k8s/helm/charts

NATS

helm repo update nats \
&& helm search repo nats/nats -l | head -n 10
helm show values nats/nats \
--version 0.17.2 \
> values.yaml
nats:
resources:
requests:
cpu: 1
memory: 2Gi
limits:
cpu: 2
memory: 2Gi

jetstream:
enabled: true

memStorage:
enabled: false
size: 1Gi

fileStorage:
enabled: true
storageDirectory: /data
size: 10Gi
accessModes:
- ReadWriteOnce

affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: nats
app.kubernetes.io/instance: nats
topologyKey: kubernetes.io/hostname
weight: 100

cluster:
enabled: true
replicas: 3

auth:
enabled: true

basic:
users:
- user: <user>
password: <password>
- nkey: <nkey-user>
helm upgrade nats nats/ntas \
--install \
--version 0.17.2 \
-n event \
-f values.yaml

NACK

CRD로 정의된 Account, Stream, StreamTemplate, Consumer를 쿠버네티스에 등록하면 자동으로 NATS 서버에 생성해주는 컨트롤러 입니다.

kubectl apply -f https://raw.githubusercontent.com/nats-io/nack/v0.7.2/deploy/crds.yml
helm repo update nats \
&& helm search repo nats/nack -l | head -n 10
helm show values nats/nack \
--version 0.17.4 \
> values.yaml
jetstream:
nats:
url: nats://nats.event:4222
helm upgrade nack nats/nack \
--install \
--version 0.17.4 \
-n event \
-f values.yaml