Skip to content

ZEISS/natz-operator

Repository files navigation

Kubernetes Operator for NATS Accounting

Release Taylor Swift Volkswagen License

A Kubernetes operator for NATS accounting.

Installation

Helm can be used to install the natz-operator to your Kubernetes cluster.

helm repo add natz-operator https://zeiss.github.io/natz-operator/helm/charts
helm repo update
helm search repo natz-operator

Usage

Creating the operator for the NATS accounting.

apiVersion: natz.zeiss.com/v1alpha1
kind: NatsOperator
metadata:
  namespace: knative-eventing
  name: natsoperator-sample
spec:

Creating an account that supports the use of jetstream.

apiVersion: natz.zeiss.com/v1alpha1
kind: NatsAccount
metadata:
  namespace: knative-eventing 
  name: knative-eventing-account
spec:
  operatorRef:
    name: natsoperator-sample 
  allowedUserNamespaces:
  - knative-eventing
  imports: []
  exports: []
  limits: 
    disk_storage: -1
    streams: -1
    conn: -1
    imports: -1
    exports: -1
    subs: -1
    payload: -1
    data: -1

Creating a user account.

apiVersion: natz.zeiss.com/v1alpha1
kind: NatsUser
metadata:
  namespace: knative-eventing
  name: knative-eventing-user
spec:
  accountRef:
    namespace: knative-eventing
    name: knative-eventing-account
  limits:
    payload: -1
    subs: -1
    data: -1

NATS Operator

The operator can be integrated with the NATS operator.

config:
  jetstream:
    enabled: true
    fileStore:
      pvc:
        size: 2Gi
  resolver:
    enabled: true
    merge:
      type: full
      interval: "2m"
      timeout: "1.9s"
  merge:
    00$include: "../custom-auth/auth.conf"
    debug: true
container:
  patch:
  - op: add
    path: "/volumeMounts/-"
    value:
      name: auth-config
      mountPath: "/etc/custom-auth"
statefulSet:
  patch:
  - op: add
    path: /spec/template/spec/volumes/-
    value:
      name: "auth-config"
      secret:
        defaultMode: 420
        secretName: "natsoperator-sample-server-config"

License

Apache 2.0