diff --git a/.env b/.env deleted file mode 100644 index d0ee6994..00000000 --- a/.env +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# NATS Server with auth, and external access. -export DEFAULT_NATS_SERVER_YML=$(pwd)/nats-server/nats-server-with-auth.yml - -# NATS Server with TLS certs. -export DEFAULT_NATS_SERVER_TLS_YML=$(pwd)/nats-server/nats-server-with-auth-and-tls.yml - -# NATS Server without TLS nor Auth enabled. -export DEFAULT_NATS_SERVER_INSECURE_YML=$(pwd)/nats-server/nats-server-plain.yml - -# Prometheus Operator yaml. -export DEFAULT_PROMETHEUS_OPERATOR_YML=$(pwd)/tools/prometheus-operator.yml -export DEFAULT_NATS_PROMETHEUS_YML=$(pwd)/tools/nats-prometheus.yml - -# NATS Surveyor -export DEFAULT_NATS_SURVEYOR_YML=$(pwd)/tools/nats-surveyor.yml -export DEFAULT_NATS_SURVEYOR_TLS_YML=$(pwd)/tools/nats-surveyor-tls.yml -export DEFAULT_NATS_GRAFANA_YML=$(pwd)/tools/nats-surveyor-grafana.yml - -# NATS Certs -export DEFAULT_CERT_MANAGER_YML=$(pwd)/nats-server/nats-certs.yml - -# NATS Box -export DEFAULT_NATS_BOX_AUTH_TLS_YML=$(pwd)/tools/nats-box-tls.yml -export DEFAULT_NATS_BOX_AUTH_YML=$(pwd)/tools/nats-box-auth.yml -export DEFAULT_NATS_BOX_YML=$(pwd)/tools/nats-box.yml - -# NSC directory -export DEFAULT_NSC_DIR=$(pwd)/nsc - -# -# Bootstrap for the one line installer -# -export DEFAULT_NATS_BOOTSTRAP_YML=$(pwd)/setup/bootstrap-policy.yml -export DEFAULT_NATS_SETUP_IMAGE=synadia/nats-setup:latest -export DEFAULT_SKIP_NSC_DIR_CHOWN="true" - -# NATS Streaming with auth and TLS. -export DEFAULT_NATS_STREAMING_AUTH_TLS_YML=$(pwd)/nats-streaming-server/nats-streaming-auth-and-tls.yml - -# NATS Server with TLS certs. -export DEFAULT_NATS_STREAMING_AUTH_YML=$(pwd)/nats-streaming-server/nats-streaming-auth.yml diff --git a/_config.yaml b/_config.yaml deleted file mode 100644 index 248b7cef..00000000 --- a/_config.yaml +++ /dev/null @@ -1,6 +0,0 @@ -exclude: - - helm/charts/nats - - helm/charts/stan - - helm/charts/nack - - helm/charts/surveyor - - helm/charts/nats-account-server diff --git a/destroy.sh b/destroy.sh deleted file mode 100755 index c826dfbe..00000000 --- a/destroy.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -echo "Cleaning up..." - -kubectl delete sts nats -kubectl delete sts stan -kubectl delete sts prometheus-nats-prometheus -kubectl delete sts prometheus-nats-surveyor -kubectl delete deployment/nats-surveyor -kubectl delete deployment/nats-surveyor-grafana -kubectl delete deployment/prometheus-operator -kubectl delete pod nats-box -kubectl delete secrets nats-sys-creds -kubectl delete secrets nats-test-creds -kubectl delete secrets nats-test2-creds -kubectl delete secrets stan-creds -kubectl delete secrets prometheus-nats-prometheus -kubectl delete secrets prometheus-nats-surveyor -kubectl delete prometheuses nats-prometheus -kubectl delete prometheuses nats-surveyor -kubectl delete cm nats-accounts -kubectl delete cm nats-config -kubectl delete svc nats -kubectl delete svc stan -kubectl delete svc grafana -kubectl delete svc nats-surveyor -kubectl delete svc nats-prometheus -kubectl delete svc nats-surveyor-prometheus -kubectl delete svc prometheus -kubectl delete svc prometheus-operator -kubectl delete secret nats-ca -kubectl delete secret nats-server-tls -kubectl delete secret nats-client-tls - diff --git a/docs/create-k8s-cluster.md b/docs/create-k8s-cluster.md deleted file mode 100644 index 218f74e3..00000000 --- a/docs/create-k8s-cluster.md +++ /dev/null @@ -1,76 +0,0 @@ -# Creating a Kubernetes cluster - -Below you can find examples of creating a small 3 nodes Kubernetes -cluster to try NATS on multiple clouds. - -## Google Kubernetes Engine - -Using [gcloud](https://cloud.google.com/sdk/gcloud/) to create a 3 nodes Kubernetes cluster: - -```sh -gcloud container clusters create nats-k8s-cluster \ - --project $YOUR_GOOGLE_CLOUD_PROJECT \ - --region us-west2 \ - --num-nodes 1 \ - --machine-type n1-standard-2 -``` - -## Amazon Kubernetes Service - -The [eksctl](https://github.com/weaveworks/eksctl) is a very helpful -tool to manage EKS clusters, you can find more docs on how to set it -up [here](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html). - -```sh -# Create 3 nodes Kubernetes cluster -eksctl create cluster --name nats-k8s-cluster \ - --nodes 3 \ - --node-type=t3.large \ - --region=eu-west-1 - -# Get the credentials for your cluster -eksctl utils write-kubeconfig --name $YOUR_EKS_NAME --region eu-west-1 -``` - -## Digital Ocean - -You can use [doctl](https://github.com/digitalocean/doctl) tool to create a cluster as follows: - -```sh -doctl kubernetes cluster create nats-k8s-nyc2 --count 3 --region nyc1 -``` - -## Azure Kubernetes Service - -```sh -# In case not done already, register to use some services: -az login -az provider register -n Microsoft.Network -az provider register -n Microsoft.Storage -az provider register -n Microsoft.Compute -az provider register -n Microsoft.ContainerService - -# Create resource group and 3 node cluster -az group create --name nats --location westus -az aks create --resource-group nats --name nats --node-count 3 --node-vm-size Standard_DS1_v2 -az aks get-credentials --resource-group nats --name nats -``` - -*Note* that in order to be able to access NATS externally you need to -provision public IPs for your cluster installing the following component [dgkanatsios/AksNodePublicIPController](https://github.com/dgkanatsios/AksNodePublicIPController): - -```sh -kubectl create -n kube-system -f https://raw.githubusercontent.com/dgkanatsios/AksNodePublicIPController/7846c78f77dc5cd4b43629bb5cb7ff3818594aee/deploy.yaml -``` - -After this component has been installed, eventually your cluster will -be provided ExternalIPs that the NATS cluster can advertise to -clients: - -``` -kubectl get nodes -o wide -NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME -aks-nodepool1-18657977-0 Ready agent 5d16h v1.13.12 10.240.0.6 52.191.186.114 Ubuntu 16.04.6 LTS 4.15.0-1060-azure docker://3.0.7 -aks-nodepool1-18657977-1 Ready agent 5d17h v1.13.12 10.240.0.4 52.229.11.82 Ubuntu 16.04.6 LTS 4.15.0-1060-azure docker://3.0.7 -aks-nodepool1-18657977-2 Ready agent 5d17h v1.13.12 10.240.0.5 13.77.149.235 Ubuntu 16.04.6 LTS 4.15.0-1060-azure docker://3.0.7 -``` diff --git a/docs/simple-setup.md b/docs/simple-setup.md deleted file mode 100644 index 6b0ffd84..00000000 --- a/docs/simple-setup.md +++ /dev/null @@ -1,69 +0,0 @@ -# Basic NATS and NATS Streaming setup in K8S - -## Minimal NATS and NATS Streaming setup - -To try NATS with the minimal components, you can start with the following: - -```sh -# Single server NATS -kubectl apply -f https://raw.githubusercontent.com/nats-io/k8s/master/nats-server/single-server-nats.yml - -kubectl apply -f https://raw.githubusercontent.com/nats-io/k8s/master/nats-streaming-server/single-server-stan.yml -``` - -This will setup for you: - -- A statefulset with a single NATS server (no auth nor TLS) - -- A single NATS Streaming node using file store with persistence - -- A `nats` headless service to which you can connect. - -- A NATS Streaming Server that uses the cluster name `stan`. - -Note that the only service that your applications have to connect is -the `nats` service, the NATS Streaming server will be available by -using NATS as a transport. - -Next, try using `nats-box` to connect to the `nats` service to confirm -that you have set both NATS and NATS Streaming correctly. - -```sh -kubectl run -i --rm --tty nats-box --image=synadia/nats-box --restart=Never - -# Send message to NATS -nats-box:~# nats-sub -s nats hello & -Listening on [hello] - -nats-box:~# nats-pub -s nats hello world -[#1] Received on [hello]: 'world' - -# Send/Receive message to STAN -nats-box:~# stan-pub -s nats -c stan hello world -Published [hello] : 'world' - -nats-box:~# stan-sub -s nats -c stan hello -Connected to nats clusterID: [stan] clientID: [stan-sub] -Listening on [hello], clientID=[stan-sub], qgroup=[] durable=[] -[#1] Received: sequence:1 subject:"hello" data:"world" timestamp:1579544643374163630 -``` - -## HA setup using StatefulSets - -In order to have higher availability you can setup NATS and NATS -Streaming (STAN) to run in clustering mode. The following commands -will setup a 3-node NATS cluster as well as a 3-node NATS Streaming -cluster that has an attached volume for persistence. - -```sh -# Create NATS cluster -kubectl apply -f https://raw.githubusercontent.com/nats-io/k8s/master/nats-server/simple-nats.yml - -# Create STAN cluster -kubectl apply -f https://raw.githubusercontent.com/nats-io/k8s/master/nats-streaming-server/simple-stan.yml -``` - -For NATS Streaming, it is actually recommended to use the Fault -Tolerance mode as that would show better performance than clustering -mode and better failover. You can follow this guide to setup -[NATS Streaming with Fault Tolerance](https://docs.nats.io/nats-on-kubernetes/stan-ft-k8s-aws). diff --git a/examples/helm-do-nats-cluster-auth.yaml b/examples/helm-do-nats-cluster-auth.yaml deleted file mode 100644 index 36ac74e4..00000000 --- a/examples/helm-do-nats-cluster-auth.yaml +++ /dev/null @@ -1,12 +0,0 @@ -nats: - image: nats:alpine - -cluster: - enabled: true - replicas: 3 - noAdvertise: false - - authorization: - user: foo - password: pwd&pwd - timeout: 0.5 diff --git a/examples/helm-do-nats-cluster-noauth.yaml b/examples/helm-do-nats-cluster-noauth.yaml deleted file mode 100644 index 7ecb5035..00000000 --- a/examples/helm-do-nats-cluster-noauth.yaml +++ /dev/null @@ -1,7 +0,0 @@ -nats: - image: nats:alpine - -cluster: - enabled: true - replicas: 3 - noAdvertise: false diff --git a/examples/helm-do-nats-js-cluster.yaml b/examples/helm-do-nats-js-cluster.yaml deleted file mode 100644 index 9b649434..00000000 --- a/examples/helm-do-nats-js-cluster.yaml +++ /dev/null @@ -1,21 +0,0 @@ -nats: - image: nats:alpine - - jetstream: - enabled: true - - memStorage: - enabled: true - size: "3Gi" - - fileStorage: - enabled: true - size: "10Gi" - storageDirectory: /data/ - storageClassName: do-block-storage - -cluster: - enabled: true - # Cluster name is required, by default will be release name. - # name: "nats" - replicas: 3 diff --git a/examples/helm-do-nats-mqtt.yaml b/examples/helm-do-nats-mqtt.yaml deleted file mode 100644 index ba2e391e..00000000 --- a/examples/helm-do-nats-mqtt.yaml +++ /dev/null @@ -1,31 +0,0 @@ -nats: - image: nats:alpine - - jetstream: - enabled: true - -mqtt: - enabled: true - -# tls: -# secret: -# name: nats-mqtt-tls -# verify: false -# insecure: true -# ca: "ca.crt" -# cert: "tls.crt" -# key: "tls.key" -# -# Create TLS secret snippet: -# kubectl create secret generic nats-mqtt-tls --from-file=tls.crt=./broker.crt --from-file=tls.key=./broker.key --from-file=ca.crt=./ca.pem - -auth: - enabled: true - basic: - users: - - user: test - password: secret - permissions: - publish: ["measurements"] - subscribe: ["measurements", "$MQTT.sub.>"] - allowed_connection_types: ["MQTT"] diff --git a/nats-server/leafnodes/lb.yaml b/nats-server/leafnodes/lb.yaml deleted file mode 100644 index cc9fdd5b..00000000 --- a/nats-server/leafnodes/lb.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: nats-lb - annotations: - service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout: "10" -spec: - type: LoadBalancer - externalTrafficPolicy: Local - selector: - app: nats - ports: - - protocol: TCP - port: 4222 - targetPort: 4222 - name: client - - protocol: TCP - port: 7422 - targetPort: 7422 - name: leafnodes diff --git a/nats-server/leafnodes/nats-cluster.yaml b/nats-server/leafnodes/nats-cluster.yaml deleted file mode 100644 index d6156ef1..00000000 --- a/nats-server/leafnodes/nats-cluster.yaml +++ /dev/null @@ -1,161 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - http: 8222 - # debug: true - - ping_interval: 30s - - cluster { - port: 6222 - no_advertise: true - - routes: [ - nats://nats-0.nats.default.svc:6222 - nats://nats-1.nats.default.svc:6222 - nats://nats-2.nats.default.svc:6222 - ] - } - - leaf { - port: 7422 - - authorization { - timeout: 3s - - users = [ - { user: "foo", pass: "bar" } - ] - } - } ---- -apiVersion: v1 -kind: Service -metadata: - name: nats - labels: - app: nats -spec: - selector: - app: nats - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 - - name: gateways - port: 7522 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - replicas: 3 - serviceName: "nats" - template: - metadata: - labels: - app: nats - spec: - # Common volumes for the containers - volumes: - - name: config-volume - configMap: - name: nats-config - - name: pid - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: nats:2.6.5-alpine - ports: - - containerPort: 4222 - name: client - hostPort: 4222 - - containerPort: 7422 - name: leafnodes - hostPort: 7422 - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "/usr/local/bin/nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: pid - mountPath: /var/run/nats - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] diff --git a/nats-server/leafnodes/stan-server.yaml b/nats-server/leafnodes/stan-server.yaml deleted file mode 100644 index f5c48c19..00000000 --- a/nats-server/leafnodes/stan-server.yaml +++ /dev/null @@ -1,115 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: stan-config -data: - stan.conf: | - port: 4222 - http: 8222 - - streaming { - ns: "nats://nats:4222" - id: stan - store: file - dir: /data/stan/store - } ---- -apiVersion: v1 -kind: Service -metadata: - name: stan - labels: - app: stan -spec: - selector: - app: stan - clusterIP: None - ports: - - name: metrics - port: 7777 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: stan - labels: - app: stan -spec: - selector: - matchLabels: - app: stan - serviceName: stan - replicas: 1 - volumeClaimTemplates: - - metadata: - name: stan-sts-vol - spec: - accessModes: - - ReadWriteOnce - volumeMode: "Filesystem" - resources: - requests: - storage: 1Gi - template: - metadata: - labels: - app: stan - spec: - # Prevent NATS Streaming pods running in same host. - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - topologyKey: "kubernetes.io/hostname" - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - stan - # STAN Server - containers: - - name: stan - image: nats-streaming:0.23.0-alpine - ports: - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - args: - - "-sc" - - "/etc/stan-config/stan.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: config-volume - mountPath: /etc/stan-config - - name: stan-sts-vol - mountPath: /data/stan - - # Disable CPU limits. - resources: - requests: - cpu: 0 - - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - volumes: - - name: config-volume - configMap: - name: stan-config \ No newline at end of file diff --git a/nats-server/nats-certs.yml b/nats-server/nats-certs.yml deleted file mode 100644 index bb424112..00000000 --- a/nats-server/nats-certs.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -apiVersion: cert-manager.io/v1alpha2 -kind: ClusterIssuer -metadata: - name: selfsigning -spec: - selfSigned: {} ---- -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - name: nats-ca -spec: - secretName: nats-ca - duration: 8736h # 1 year - renewBefore: 240h # 10 days - issuerRef: - name: selfsigning - kind: ClusterIssuer - commonName: nats-ca - organization: - - Your organization - isCA: true ---- -apiVersion: cert-manager.io/v1alpha2 -kind: Issuer -metadata: - name: nats-ca -spec: - ca: - secretName: nats-ca ---- -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - name: nats-server-tls -spec: - secretName: nats-server-tls - duration: 2160h # 90 days - renewBefore: 240h # 10 days - issuerRef: - name: nats-ca - kind: Issuer - organization: - - NATS.io - commonName: nats.default.svc.cluster.local - dnsNames: - - nats - - nats.default - - nats.default.svc - - nats.default.svc.cluster.local - - '*.nats' - - '*.nats.default' - - '*.nats.default.svc' ---- -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - name: nats-client-tls -spec: - secretName: nats-client-tls - duration: 2160h # 90 days - renewBefore: 240h # 10 days - issuerRef: - name: nats-ca - kind: Issuer - organization: - - NATS.io - commonName: sample-nats-client diff --git a/nats-server/nats-js-leaf.yml b/nats-server/nats-js-leaf.yml deleted file mode 100644 index 9bf1fe87..00000000 --- a/nats-server/nats-js-leaf.yml +++ /dev/null @@ -1,158 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-js-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - http: 8222 - - jetstream { - store_dir: "/data/jetstream/store" - max_file_store: 1G - } - - leafnodes { - remotes [ - { - url: "nats://nats:7422" - } - ] - } ---- -apiVersion: v1 -kind: Service -metadata: - name: nats-js - labels: - app: nats-js -spec: - selector: - app: nats-js - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 - - name: gateways - port: 7522 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats-js - labels: - app: nats-js -spec: - selector: - matchLabels: - app: nats-js - replicas: 1 - serviceName: "nats-js" - volumeClaimTemplates: - - metadata: - name: nats-js-sts-vol - spec: - accessModes: - - ReadWriteOnce - volumeMode: "Filesystem" - resources: - requests: - storage: 1Gi - template: - metadata: - labels: - app: nats-js - spec: - # Common volumes for the containers - volumes: - - name: config-volume - configMap: - name: nats-js-config - - name: pid - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: synadia/nats-server:nightly - ports: - - containerPort: 4222 - name: client - - containerPort: 7422 - name: leafnodes - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats-js.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: pid - mountPath: /var/run/nats - - name: nats-js-sts-vol - mountPath: /data/jetstream - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] diff --git a/nats-server/nats-server-plain.yml b/nats-server/nats-server-plain.yml deleted file mode 100644 index 6f477b8b..00000000 --- a/nats-server/nats-server-plain.yml +++ /dev/null @@ -1,191 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - - debug = false - trace = false - - http: 8222 - - cluster { - port: 6222 - - routes [ - nats://nats-0.nats.default.svc:6222 - nats://nats-1.nats.default.svc:6222 - nats://nats-2.nats.default.svc:6222 - ] - - cluster_advertise: $CLUSTER_ADVERTISE - connect_retries: 30 - } ---- -apiVersion: v1 -kind: Service -metadata: - name: nats - labels: - app: nats -spec: - selector: - app: nats - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 - - name: gateways - port: 7522 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - replicas: 3 - serviceName: "nats" - template: - metadata: - labels: - app: nats - spec: - # Common volumes for the containers - volumes: - - name: config-volume - configMap: - name: nats-config - - name: pid - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: nats:2.6.5-alpine - ports: - - containerPort: 4222 - name: client - hostPort: 4222 - - containerPort: 7422 - name: leafnodes - hostPort: 7422 - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: pid - mountPath: /var/run/nats - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] - - ################################# - # # - # NATS Configuration Reloader # - # # - ################################# - - name: reloader - image: natsio/nats-server-config-reloader:0.6.2 - command: - - "nats-server-config-reloader" - - "-pid" - - "/var/run/nats/nats.pid" - - "-config" - - "/etc/nats-config/nats.conf" - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: pid - mountPath: /var/run/nats - - ############################## - # # - # NATS Prometheus Exporter # - # # - ############################## - - name: metrics - image: natsio/prometheus-nats-exporter:0.9.0 - args: - - -connz - - -routez - - -subz - - -varz - - -prefix=nats - - -use_internal_server_id - - -DV - - http://localhost:8222/ - ports: - - containerPort: 7777 - name: metrics diff --git a/nats-server/nats-server-with-auth-and-tls.yml b/nats-server/nats-server-with-auth-and-tls.yml deleted file mode 100644 index 308aed29..00000000 --- a/nats-server/nats-server-with-auth-and-tls.yml +++ /dev/null @@ -1,314 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - - http: 8222 - - tls: { - ca_file: "/etc/nats-server-tls-certs/ca.crt", - cert_file: "/etc/nats-server-tls-certs/tls.crt", - key_file: "/etc/nats-server-tls-certs/tls.key", - timeout: 3 - } - - cluster { - port: 6222 - - routes [ - nats://nats:6222 - ] - - tls: { - ca_file: "/etc/nats-server-tls-certs/ca.crt", - cert_file: "/etc/nats-server-tls-certs/tls.crt", - key_file: "/etc/nats-server-tls-certs/tls.key", - timeout: 3 - } - - cluster_advertise: $CLUSTER_ADVERTISE - connect_retries: 60 - } - - ############################################# - # # - # Advertise the public ip of the Kubelet # - # where this NATS Server node is running # - # # - ############################################# - leafnodes { - listen: "0.0.0.0:7422" - include "advertise/gateway_advertise.conf" - - tls: { - ca_file: "/etc/nats-server-tls-certs/ca.crt", - cert_file: "/etc/nats-server-tls-certs/tls.crt", - key_file: "/etc/nats-server-tls-certs/tls.key", - timeout: 3 - } - } - include "advertise/client_advertise.conf" - - ############################################# - # # - # Accounts resolver config # - # # - ############################################# - include "accounts/resolver.conf" - ---- -apiVersion: v1 -kind: Service -metadata: - name: nats - labels: - app: nats -spec: - selector: - app: nats - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 - - name: gateways - port: 7522 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - replicas: 3 - serviceName: "nats" - template: - metadata: - labels: - app: nats - spec: - # Common volumes for the containers - volumes: - - name: nats-ca - secret: - secretName: nats-ca - - name: nats-server-tls-volume - secret: - secretName: nats-server-tls - - name: config-volume - configMap: - name: nats-config - - name: accounts-volume - configMap: - name: nats-accounts - - name: pid - emptyDir: {} - - name: advertiseconfig - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - # Required to be able to lookup external public ip - # that is setup as the client advertise. - serviceAccountName: nats-server - - # Initializer container required to be able to lookup - # the external ip on which this node is running. - initContainers: - - name: bootconfig - command: - - nats-pod-bootconfig - - -f - - /etc/nats-config/advertise/client_advertise.conf - - -gf - - /etc/nats-config/advertise/gateway_advertise.conf - env: - - name: KUBERNETES_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - image: natsio/nats-boot-config:0.5.4 - imagePullPolicy: IfNotPresent - volumeMounts: - - mountPath: /etc/nats-config/advertise - name: advertiseconfig - subPath: advertise - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: nats:2.6.5-alpine - ports: - - containerPort: 4222 - name: client - hostPort: 4222 - - containerPort: 7422 - name: leafnodes - hostPort: 7422 - - containerPort: 7522 - name: gateways - hostPort: 7522 - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: accounts-volume - mountPath: /etc/nats-config/accounts - - name: nats-server-tls-volume - mountPath: /etc/nats-server-tls-certs - - name: pid - mountPath: /var/run/nats - - mountPath: /etc/nats-config/advertise - name: advertiseconfig - subPath: advertise - - # Disable all cpu limits for the server. - # - resources: - requests: - cpu: 0 - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] - - ################################# - # # - # NATS Configuration Reloader # - # # - ################################# - - name: reloader - image: natsio/nats-server-config-reloader:0.6.2 - command: - - "nats-server-config-reloader" - - "-pid" - - "/var/run/nats/nats.pid" - - "-config" - - "/etc/nats-config/nats.conf" - - "-config" - - "/etc/nats-config/accounts/resolver.conf" - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: accounts-volume - mountPath: /etc/nats-config/accounts - - name: pid - mountPath: /var/run/nats - - ############################## - # # - # NATS Prometheus Exporter # - # # - ############################## - - name: metrics - image: natsio/prometheus-nats-exporter:0.9.0 - args: - - -connz - - -routez - - -subz - - -varz - - -prefix=nats - - -use_internal_server_id - - -DV - - http://localhost:8222/ - ports: - - containerPort: 7777 - name: metrics ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: nats-server - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: nats-server -rules: -- apiGroups: [""] - resources: - - nodes - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: nats-server-binding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: nats-server -subjects: -- kind: ServiceAccount - name: nats-server - namespace: default diff --git a/nats-server/nats-server-with-auth.yml b/nats-server/nats-server-with-auth.yml deleted file mode 100644 index 05719753..00000000 --- a/nats-server/nats-server-with-auth.yml +++ /dev/null @@ -1,279 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - - http: 8222 - - cluster { - port: 6222 - - # Use explicit static routes to avoid intermittent DNS issues - # that could cause partitions via gossip while bootstrapping. - routes [ - nats://nats-0.nats.default.svc:6222 - nats://nats-1.nats.default.svc:6222 - nats://nats-2.nats.default.svc:6222 - ] - - cluster_advertise: $CLUSTER_ADVERTISE - connect_retries: 30 - } - - ############################################# - # # - # Advertise the public ip of the Kubelet # - # where this NATS Server node is running # - # # - ############################################# - leafnodes { - listen: "0.0.0.0:7422" - include "advertise/gateway_advertise.conf" - } - include "advertise/client_advertise.conf" - - # Load the trusted operator setup. - include "accounts/resolver.conf" - ---- -apiVersion: v1 -kind: Service -metadata: - name: nats - labels: - app: nats -spec: - selector: - app: nats - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 - - name: gateways - port: 7522 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - replicas: 3 - serviceName: "nats" - template: - metadata: - labels: - app: nats - spec: - # Common volumes for the containers - volumes: - - name: config-volume - configMap: - name: nats-config - - name: accounts-volume - configMap: - name: nats-accounts - - name: pid - emptyDir: {} - - name: advertiseconfig - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - # Required to be able to lookup external public ip - # that is setup as the client advertise. - serviceAccountName: nats-server - - # Initializer container required to be able to lookup - # the external ip on which this node is running. - initContainers: - - name: bootconfig - command: - - nats-pod-bootconfig - - -f - - /etc/nats-config/advertise/client_advertise.conf - - -gf - - /etc/nats-config/advertise/gateway_advertise.conf - env: - - name: KUBERNETES_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - image: natsio/nats-boot-config:0.5.4 - imagePullPolicy: IfNotPresent - volumeMounts: - - mountPath: /etc/nats-config/advertise - name: advertiseconfig - subPath: advertise - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: nats:2.6.5-alpine - ports: - - containerPort: 4222 - name: client - hostPort: 4222 - - containerPort: 7422 - name: leafnodes - hostPort: 7422 - - containerPort: 7522 - name: gateways - hostPort: 7522 - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: accounts-volume - mountPath: /etc/nats-config/accounts - - name: pid - mountPath: /var/run/nats - - mountPath: /etc/nats-config/advertise - name: advertiseconfig - subPath: advertise - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] - - ################################# - # # - # NATS Configuration Reloader # - # # - ################################# - - name: reloader - image: natsio/nats-server-config-reloader:0.6.2 - command: - - "nats-server-config-reloader" - - "-pid" - - "/var/run/nats/nats.pid" - - "-config" - - "/etc/nats-config/nats.conf" - - "-config" - - "/etc/nats-config/accounts/resolver.conf" - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: accounts-volume - mountPath: /etc/nats-config/accounts - - name: pid - mountPath: /var/run/nats - - ############################## - # # - # NATS Prometheus Exporter # - # # - ############################## - - name: metrics - image: natsio/prometheus-nats-exporter:0.9.0 - args: - - -connz - - -routez - - -subz - - -varz - - -prefix=nats - - -use_internal_server_id - - -DV - - http://localhost:8222/ - ports: - - containerPort: 7777 - name: metrics ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: nats-server - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: nats-server -rules: -- apiGroups: [""] - resources: - - nodes - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: nats-server-binding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: nats-server -subjects: -- kind: ServiceAccount - name: nats-server - namespace: default \ No newline at end of file diff --git a/nats-server/nats-server-without-auth.yml b/nats-server/nats-server-without-auth.yml deleted file mode 100644 index cfd0aacb..00000000 --- a/nats-server/nats-server-without-auth.yml +++ /dev/null @@ -1,282 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - - http: 8222 - - cluster { - port: 6222 - - # Use explicit static routes to avoid intermittent DNS issues - # that could cause partitions via gossip while bootstrapping. - routes [ - nats://nats-0.nats:6222 - nats://nats-1.nats:6222 - nats://nats-2.nats:6222 - ] - - cluster_advertise: $CLUSTER_ADVERTISE - connect_retries: 60 - } - - ############################################# - # Advertise the public ip of the Kubelet # - # where this NATS Server node is running # - ############################################# - leafnodes { - listen: "0.0.0.0:7422" - include "advertise/gateway_advertise.conf" - } - include "advertise/client_advertise.conf" - - ############################################# - # # - # Accounts resolver config # - # # - ############################################# - include "accounts/resolver.conf" - ---- -apiVersion: v1 -kind: Service -metadata: - name: nats - labels: - app: nats -spec: - selector: - app: nats - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - replicas: 3 - serviceName: "nats" - template: - metadata: - labels: - app: nats - spec: - # Common volumes for the containers - volumes: - - name: config-volume - configMap: - name: nats-config - - name: accounts-volume - configMap: - name: nats-accounts - - name: pid - emptyDir: {} - - name: advertiseconfig - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - # Required to be able to lookup external public ip - # that is setup as the client advertise. - serviceAccountName: nats-server - - # Initializer container required to be able to lookup - # the external ip on which this node is running. - initContainers: - - name: bootconfig - command: - - nats-pod-bootconfig - - -f - - /etc/nats-config/advertise/client_advertise.conf - - -gf - - /etc/nats-config/advertise/gateway_advertise.conf - env: - - name: KUBERNETES_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - image: natsio/nats-boot-config:0.5.4 - imagePullPolicy: IfNotPresent - volumeMounts: - - mountPath: /etc/nats-config/advertise - name: advertiseconfig - subPath: advertise - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: nats:2.6.5-alpine - ports: - - containerPort: 4222 - name: client - hostPort: 4222 - - containerPort: 7422 - name: leafnodes - hostPort: 7422 - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: accounts-volume - mountPath: /etc/nats-config/accounts - - name: pid - mountPath: /var/run/nats - - mountPath: /etc/nats-config/advertise - name: advertiseconfig - subPath: advertise - - # Disable all cpu limits for the server. - # - resources: - requests: - cpu: 0 - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] - - ################################# - # # - # NATS Configuration Reloader # - # # - ################################# - - name: reloader - image: natsio/nats-server-config-reloader:0.6.2 - command: - - "nats-server-config-reloader" - - "-pid" - - "/var/run/nats/nats.pid" - - "-config" - - "/etc/nats-config/nats.conf" - - "-config" - - "/etc/nats-config/accounts/resolver.conf" - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: accounts-volume - mountPath: /etc/nats-config/accounts - - name: pid - mountPath: /var/run/nats - - ############################## - # # - # NATS Prometheus Exporter # - # # - ############################## - - name: metrics - image: natsio/prometheus-nats-exporter:0.9.0 - args: - - -connz - - -routez - - -subz - - -varz - - -prefix=nats - - -use_internal_server_id - - -DV - - http://localhost:8222/ - ports: - - containerPort: 7777 - name: metrics ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: nats-server - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: nats-server -rules: -- apiGroups: [""] - resources: - - nodes - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: nats-server-binding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: nats-server -subjects: -- kind: ServiceAccount - name: nats-server - namespace: default diff --git a/nats-server/simple-nats.yml b/nats-server/simple-nats.yml deleted file mode 100644 index 54a16974..00000000 --- a/nats-server/simple-nats.yml +++ /dev/null @@ -1,151 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - http: 8222 - - cluster { - port: 6222 - routes [ - nats://nats-0.nats.default.svc:6222 - nats://nats-1.nats.default.svc:6222 - nats://nats-2.nats.default.svc:6222 - ] - - cluster_advertise: $CLUSTER_ADVERTISE - connect_retries: 30 - } - - leafnodes { - port: 7422 - } ---- -apiVersion: v1 -kind: Service -metadata: - name: nats - labels: - app: nats -spec: - selector: - app: nats - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 - - name: gateways - port: 7522 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - replicas: 3 - serviceName: "nats" - template: - metadata: - labels: - app: nats - spec: - # Common volumes for the containers - volumes: - - name: config-volume - configMap: - name: nats-config - - name: pid - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: nats:2.6.5-alpine - ports: - - containerPort: 4222 - name: client - hostPort: 4222 - - containerPort: 7422 - name: leafnodes - hostPort: 7422 - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: pid - mountPath: /var/run/nats - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] diff --git a/nats-server/single-server-nats.yml b/nats-server/single-server-nats.yml deleted file mode 100644 index f0c4ca8f..00000000 --- a/nats-server/single-server-nats.yml +++ /dev/null @@ -1,135 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nats-config -data: - nats.conf: | - pid_file: "/var/run/nats/nats.pid" - http: 8222 ---- -apiVersion: v1 -kind: Service -metadata: - name: nats - labels: - app: nats -spec: - selector: - app: nats - clusterIP: None - ports: - - name: client - port: 4222 - - name: cluster - port: 6222 - - name: monitor - port: 8222 - - name: metrics - port: 7777 - - name: leafnodes - port: 7422 - - name: gateways - port: 7522 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - replicas: 1 - serviceName: "nats" - template: - metadata: - labels: - app: nats - spec: - # Common volumes for the containers - volumes: - - name: config-volume - configMap: - name: nats-config - - name: pid - emptyDir: {} - - # Required to be able to HUP signal and apply config reload - # to the server without restarting the pod. - shareProcessNamespace: true - - ################# - # # - # NATS Server # - # # - ################# - terminationGracePeriodSeconds: 60 - containers: - - name: nats - image: nats:2.6.5-alpine - ports: - - containerPort: 4222 - name: client - hostPort: 4222 - - containerPort: 7422 - name: leafnodes - hostPort: 7422 - - containerPort: 6222 - name: cluster - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - command: - - "nats-server" - - "--config" - - "/etc/nats-config/nats.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CLUSTER_ADVERTISE - value: $(POD_NAME).nats.$(POD_NAMESPACE).svc - volumeMounts: - - name: config-volume - mountPath: /etc/nats-config - - name: pid - mountPath: /var/run/nats - - # Liveness/Readiness probes against the monitoring - # - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - # Gracefully stop NATS Server on pod deletion or image upgrade. - # - lifecycle: - preStop: - exec: - # Using the alpine based NATS image, we add an extra sleep that is - # the same amount as the terminationGracePeriodSeconds to allow - # the NATS Server to gracefully terminate the client connections. - # - command: ["/bin/sh", "-c", "/nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 60"] diff --git a/nats-streaming-server/nats-streaming-auth-and-tls.yml b/nats-streaming-server/nats-streaming-auth-and-tls.yml deleted file mode 100644 index fb17b2e8..00000000 --- a/nats-streaming-server/nats-streaming-auth-and-tls.yml +++ /dev/null @@ -1,166 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: stan-config -data: - stan.conf: | - port: 4222 - http: 8222 - - leafnodes { - remotes = [ - { - url: "nats://nats:7422" - credentials: "/var/run/nats/secrets/stan.creds" - tls: { - ca_file: "/etc/nats/certs/ca.crt", - cert_file: "/etc/nats/certs/tls.crt", - key_file: "/etc/nats/certs/tls.key", - timeout: 3 - } - } - ] - } - - streaming { - id: stan - store: file - dir: /data/stan/store - - cluster { - node_id: $POD_NAME - - log_path: /data/stan/log - - # Explicit names of resulting peers - peers: ["stan-0", "stan-1", "stan-2"] - } - } - ---- -apiVersion: v1 -kind: Service -metadata: - name: stan - labels: - app: stan -spec: - selector: - app: stan - clusterIP: None - ports: - - name: metrics - port: 7777 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: stan - labels: - app: stan -spec: - selector: - matchLabels: - app: stan - serviceName: stan - replicas: 3 - volumeClaimTemplates: - - metadata: - name: stan-sts-vol - spec: - accessModes: - - ReadWriteOnce - volumeMode: "Filesystem" - resources: - requests: - storage: 1Gi - template: - metadata: - labels: - app: stan - spec: - volumes: - - name: config-volume - configMap: - name: stan-config - - name: creds-volume - secret: - secretName: stan-creds - - name: nats-server-tls-volume - secret: - secretName: nats-server-tls - - # Prevent NATS Streaming pods running in same host. - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - topologyKey: "kubernetes.io/hostname" - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - stan - # STAN Server - containers: - - name: stan - image: nats-streaming:0.23.0 - ports: - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - args: - - "-sc" - - "/etc/stan-config/stan.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: config-volume - mountPath: /etc/stan-config - - name: creds-volume - mountPath: /var/run/nats/secrets - - name: stan-sts-vol - mountPath: /data/stan - - name: nats-server-tls-volume - mountPath: /etc/nats/certs - - # Disable CPU limits. - resources: - requests: - cpu: 0 - - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - name: metrics - image: natsio/prometheus-nats-exporter:0.9.0 - args: - - -connz - - -routez - - -subz - - -varz - - -channelz - - -serverz - # - -prefix=stan - - -use_internal_server_id - - -DV - - http://localhost:8222/ - ports: - - containerPort: 7777 - name: metrics diff --git a/nats-streaming-server/nats-streaming-auth.yml b/nats-streaming-server/nats-streaming-auth.yml deleted file mode 100644 index 4fa2666b..00000000 --- a/nats-streaming-server/nats-streaming-auth.yml +++ /dev/null @@ -1,154 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: stan-config -data: - stan.conf: | - port: 4222 - http: 8222 - - leafnodes { - remotes = [ - { - url: "nats://nats:7422" - credentials: "/var/run/nats/secrets/stan.creds" - } - ] - } - - streaming { - id: stan - store: file - dir: /data/stan/store - - cluster { - node_id: $POD_NAME - - log_path: /data/stan/log - - # Explicit names of resulting peers - peers: ["stan-0", "stan-1", "stan-2"] - } - } - ---- -apiVersion: v1 -kind: Service -metadata: - name: stan - labels: - app: stan -spec: - selector: - app: stan - clusterIP: None - ports: - - name: metrics - port: 7777 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: stan - labels: - app: stan -spec: - selector: - matchLabels: - app: stan - serviceName: stan - replicas: 3 - volumeClaimTemplates: - - metadata: - name: stan-sts-vol - spec: - accessModes: - - ReadWriteOnce - volumeMode: "Filesystem" - resources: - requests: - storage: 1Gi - template: - metadata: - labels: - app: stan - spec: - # Prevent NATS Streaming pods running in same host. - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - topologyKey: "kubernetes.io/hostname" - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - stan - # STAN Server - containers: - - name: stan - image: nats-streaming:0.23.0 - ports: - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - args: - - "-sc" - - "/etc/stan-config/stan.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: config-volume - mountPath: /etc/stan-config - - name: creds-volume - mountPath: /var/run/nats/secrets - - name: stan-sts-vol - mountPath: /data/stan - - # Disable CPU limits. - resources: - requests: - cpu: 0 - - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - - name: metrics - image: natsio/prometheus-nats-exporter:0.9.0 - args: - - -connz - - -routez - - -subz - - -varz - - -channelz - - -serverz - # - -prefix=stan - - -use_internal_server_id - - -DV - - http://localhost:8222/ - ports: - - containerPort: 7777 - name: metrics - volumes: - - name: config-volume - configMap: - name: stan-config - - name: creds-volume - secret: - secretName: stan-creds diff --git a/nats-streaming-server/simple-stan.yml b/nats-streaming-server/simple-stan.yml deleted file mode 100644 index 0281a0b4..00000000 --- a/nats-streaming-server/simple-stan.yml +++ /dev/null @@ -1,122 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: stan-config -data: - stan.conf: | - port: 4222 - http: 8222 - - streaming { - ns: "nats://nats:4222" - - id: stan - store: file - dir: /data/stan/store - cluster { - node_id: $POD_NAME - log_path: /data/stan/log - # Explicit names of resulting peers - peers: ["stan-0", "stan-1", "stan-2"] - } - } ---- -apiVersion: v1 -kind: Service -metadata: - name: stan - labels: - app: stan -spec: - selector: - app: stan - clusterIP: None - ports: - - name: metrics - port: 7777 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: stan - labels: - app: stan -spec: - selector: - matchLabels: - app: stan - serviceName: stan - replicas: 3 - volumeClaimTemplates: - - metadata: - name: stan-sts-vol - spec: - accessModes: - - ReadWriteOnce - volumeMode: "Filesystem" - resources: - requests: - storage: 1Gi - template: - metadata: - labels: - app: stan - spec: - # Prevent NATS Streaming pods running in same host. - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - topologyKey: "kubernetes.io/hostname" - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - stan - # STAN Server - containers: - - name: stan - image: nats-streaming:0.23.0 - ports: - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - args: - - "-sc" - - "/etc/stan-config/stan.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: config-volume - mountPath: /etc/stan-config - - name: stan-sts-vol - mountPath: /data/stan - - # Disable CPU limits. - resources: - requests: - cpu: 0 - - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - volumes: - - name: config-volume - configMap: - name: stan-config diff --git a/nats-streaming-server/single-server-stan.yml b/nats-streaming-server/single-server-stan.yml deleted file mode 100644 index f7137fc4..00000000 --- a/nats-streaming-server/single-server-stan.yml +++ /dev/null @@ -1,115 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: stan-config -data: - stan.conf: | - port: 4222 - http: 8222 - - streaming { - ns: "nats://nats:4222" - id: stan - store: file - dir: /data/stan/store - } ---- -apiVersion: v1 -kind: Service -metadata: - name: stan - labels: - app: stan -spec: - selector: - app: stan - clusterIP: None - ports: - - name: metrics - port: 7777 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: stan - labels: - app: stan -spec: - selector: - matchLabels: - app: stan - serviceName: stan - replicas: 1 - volumeClaimTemplates: - - metadata: - name: stan-sts-vol - spec: - accessModes: - - ReadWriteOnce - volumeMode: "Filesystem" - resources: - requests: - storage: 1Gi - template: - metadata: - labels: - app: stan - spec: - # Prevent NATS Streaming pods running in same host. - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - topologyKey: "kubernetes.io/hostname" - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - stan - # STAN Server - containers: - - name: stan - image: nats-streaming:0.23.0 - ports: - - containerPort: 8222 - name: monitor - - containerPort: 7777 - name: metrics - args: - - "-sc" - - "/etc/stan-config/stan.conf" - - # Required to be able to define an environment variable - # that refers to other environment variables. This env var - # is later used as part of the configuration file. - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: config-volume - mountPath: /etc/stan-config - - name: stan-sts-vol - mountPath: /data/stan - - # Disable CPU limits. - resources: - requests: - cpu: 0 - - livenessProbe: - httpGet: - path: / - port: 8222 - initialDelaySeconds: 10 - timeoutSeconds: 5 - volumes: - - name: config-volume - configMap: - name: stan-config diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 385d59a3..00000000 --- a/setup.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -set -eu - -NATS_K8S_VERSION=${DEFAULT_NATS_K8S_VERSION:=https://raw.githubusercontent.com/nats-io/k8s/93c2a213bd26791fda29da2b7238e3f3b1ca36e1} -NATS_BOOTSTRAP_YML=${DEFAULT_NATS_BOOTSTRAP_YML:=$NATS_K8S_VERSION/setup/bootstrap-policy.yml} -NATS_SETUP_IMAGE=${DEFAULT_NATS_SETUP_IMAGE:=synadia/nats-setup:0.1.6} - -# Apply policy required to be able to create the resources. -kubectl apply -f "$NATS_BOOTSTRAP_YML" - -# Run nats-setup container containing the latest set of manifests. -cat < Setup the cluster in the specified namespace - --without-tls Setup the cluster without TLS enabled - --without-auth Setup the cluster without Auth enabled - --without-surveyor Skips installing NATS surveyor - --without-cert-manager Skips installing the cert manager component - --without-nats-streaming Setup the cluster without NATS Streaming -``` - -### Building nats-setup container image - -```sh -git clone https://github.com/nats-io/k8s/ -cd setup -docker build -t synadia/nats-setup:latest . -``` diff --git a/setup/bootstrap-policy.yml b/setup/bootstrap-policy.yml deleted file mode 100644 index d74de68a..00000000 --- a/setup/bootstrap-policy.yml +++ /dev/null @@ -1,179 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: nats-setup - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: nats-setup-binding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: nats-setup -subjects: -- kind: ServiceAccount - name: nats-setup - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: nats-setup -rules: -- apiGroups: [""] - resources: - - nodes - verbs: ["*"] -# Allowed actions on Pods -- apiGroups: [""] - resources: - - pods - verbs: ["create", "watch", "get", "patch", "update", "delete", "list"] - -# Allowed actions on Statefulsets and Deployments -- apiGroups: ["apps"] - resources: - - deployments - - statefulsets - verbs: ["*"] - -# Allowed actions on Statefulsets and Deployments -- apiGroups: ["extensions"] - resources: - - deployments - - ingresses - - ingresses/finalizers - verbs: ["get", "create", "watch", "get", "patch", "update", "delete", "list"] - -# Allowed actions on Services -- apiGroups: [""] - resources: - - services - - services/finalizers - verbs: ["create", "watch", "get", "patch", "update", "delete", "list"] - -# Allowed actions on Secrets -- apiGroups: [""] - resources: - - secrets - verbs: ["*"] - -# Allowed actions on ConfigMaps -- apiGroups: [""] - resources: - - configmaps - verbs: ["*"] - -# Allow all actions on some special subresources -- apiGroups: [""] - resources: - - pods/exec - - pods/log - - serviceaccounts/token - - events - verbs: ["*"] - -# Allow listing Namespaces and ServiceAccounts -- apiGroups: [""] - resources: - - namespaces - - serviceaccounts - verbs: ["create", "watch", "get", "update", "delete", "list", "patch"] - -# Allow actions on Endpoints -- apiGroups: [""] - resources: - - endpoints - verbs: ["create", "watch", "get", "update", "delete", "list"] - -#################################### -# # -# Prometheus Operator related # -# # -#################################### -- apiGroups: ["rbac.authorization.k8s.io"] - resources: - - roles - - rolebindings - - clusterroles - - clusterrolebindings - verbs: ["*"] - # verbs: ["create", "watch", "get", "update", "delete", "list", "patch"] -- apiGroups: ["monitoring.coreos.com"] - resources: - - servicemonitors - - prometheuses - - prometheuses/finalizers - - alertmanagers - - alertmanagers/finalizers - - podmonitors - - prometheusrules - verbs: ["*"] -- apiGroups: ["apiextensions.k8s.io"] - resources: - - customresourcedefinitions - verbs: ["*"] -- nonResourceURLs: - - /metrics - verbs: - - get - -#################################### -# # -# Cert Manager related # -# # -#################################### -- apiGroups: ["acme.cert-manager.io"] - resources: - - challenges - - challenges/status - - challenges/finalizers - - orders - - orders/status - - orders/finalizers - verbs: ["*"] -- apiGroups: ["admission.cert-manager.io"] - resources: - - certificaterequests - - certificates - - clusterissuers - - clusterissuers/status - - issuers - verbs: ["*"] -- apiGroups: ["admissionregistration.k8s.io"] - resources: - - mutatingwebhookconfigurations - - validatingwebhookconfigurations - verbs: ["*"] -- apiGroups: ["apiregistration.k8s.io"] - resources: - - apiservices - verbs: ["*"] -- apiGroups: ["authentication.k8s.io"] - resources: - - tokenreviews - verbs: ["*"] -- apiGroups: ["authorization.k8s.io"] - resources: - - subjectaccessreviews - verbs: ["*"] -- apiGroups: ["cert-manager.io"] - resources: - - certificaterequests - - certificates - - certificates/finalizers - - certificates/status - - certificaterequests/status - - clusterissuers - - clusterissuers/status - - issuers - - issuers/status - verbs: ["*"] -# - apiGroups: ["extensions"] -# resources: -# - ingresses -# - ingresses/finalizers -# verbs: ["*"] diff --git a/setup/grafana/Dockerfile b/setup/grafana/Dockerfile deleted file mode 100644 index 067b820c..00000000 --- a/setup/grafana/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM grafana/grafana:5.4.3 - -COPY ./provisioning /etc/grafana/provisioning - diff --git a/setup/grafana/README.md b/setup/grafana/README.md deleted file mode 100644 index dbb5a579..00000000 --- a/setup/grafana/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Makefile for building the NATS Surveyor Grafana docker image - -In order to simplify the Kubernetes install of Surveyor, a nats-surveyor-grafana -docker image is built. The makefile has `build` and `push` targets. - -## Build - -`$ make build` downloads the current dashboard from github and packages it up -in the containter. - -## Push - -`$ make push` pushes the image to the `synadia` docker organization. - diff --git a/setup/grafana/makefile b/setup/grafana/makefile deleted file mode 100644 index 7291423a..00000000 --- a/setup/grafana/makefile +++ /dev/null @@ -1,17 +0,0 @@ -IMAGE := connecteverything/nats-surveyor-grafana -TAG := 0.1.0 -SURVEYOR_REPO := $(GOPATH)/src/github.com/nats-io/nats-surveyor -SURVEYOR_DASH := https://raw.githubusercontent.com/nats-io/nats-surveyor/master/docker-compose/grafana/provisioning/dashboards/nats-surveyor-dashboard.json - -build: - $(info Make: Building "$(TAG)" tagged images.) - mkdir -p provisioning/dashboards - curl $(SURVEYOR_DASH) --output provisioning/dashboards/nats-surveyor-dashboard.json - cp -R $(SURVEYOR_REPO)/docker-compose/grafana/provisioning . - @docker build -t $(IMAGE):$(TAG) . - @docker tag $(IMAGE):$(TAG) $(IMAGE):latest - -push: - $(info Make: Pushing "$(TAG)" tagged image.) - @docker push $(IMAGE):$(TAG) - @docker push $(IMAGE):latest diff --git a/setup/grafana/provisioning/dashboards/all.yml b/setup/grafana/provisioning/dashboards/all.yml deleted file mode 100644 index 33f4d995..00000000 --- a/setup/grafana/provisioning/dashboards/all.yml +++ /dev/null @@ -1,11 +0,0 @@ -# # config file version -apiVersion: 1 - -providers: -- name: 'default' - org_id: 1 - folder: '' - type: 'file' - editable: true - options: - folder: '/etc//grafana/provisioning/dashboards' diff --git a/setup/grafana/provisioning/dashboards/nats-surveyor-dashboard.json b/setup/grafana/provisioning/dashboards/nats-surveyor-dashboard.json deleted file mode 100644 index 39fbee73..00000000 --- a/setup/grafana/provisioning/dashboards/nats-surveyor-dashboard.json +++ /dev/null @@ -1,3860 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 1, - "id": 2, - "iteration": 1572565159614, - "links": [], - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Combined messages received by all servers", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 0, - "y": 0 - }, - "id": 79, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(rate(nats_core_recv_msgs_count[1m]))", - "legendFormat": "Received", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Received Messages", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Combined messages sent by all servers", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 3, - "y": 0 - }, - "id": 80, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(rate(nats_core_sent_msgs_count[1m]))", - "legendFormat": "Sent", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Sent Messages", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Combined bytes received by all servers", - "format": "Bps", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 6, - "y": 0 - }, - "id": 53, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(rate(nats_core_recv_bytes[1m]))", - "legendFormat": "Received", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Received Bytes", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Combined bytes sent by all servers", - "format": "Bps", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 9, - "y": 0 - }, - "id": 52, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(rate(nats_core_sent_bytes[1m]))", - "legendFormat": "Sent", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Sent Bytes", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorPrefix": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Total current connections across all servers", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 2, - "x": 12, - "y": 0 - }, - "id": 45, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(nats_core_connection_count)", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Connections", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Slow consumers seen per second", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 2, - "x": 14, - "y": 0 - }, - "id": 56, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(rate(nats_core_slow_consumer_count[1m]))", - "legendFormat": "Slow", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Slow Consumers", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Number of known clusters", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 2, - "x": 16, - "y": 0 - }, - "id": 55, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(sum(nats_core_info) by (server_cluster))", - "legendFormat": "Servers", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Clusters", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Number of known servers", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 2, - "x": 18, - "y": 0 - }, - "id": 78, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(nats_core_info)", - "legendFormat": "Servers", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Servers", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Number of routes reported as active", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 2, - "x": 20, - "y": 0 - }, - "id": 49, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(nats_core_route_count)", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Route Connections", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Number of routes reported as active", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 2, - "x": 22, - "y": 0 - }, - "id": 50, - "interval": "", - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true, - "ymax": null, - "ymin": null - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(nats_core_gateway_count)", - "legendFormat": "Gateways", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Gateway Connections", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - }, - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 4 - }, - "id": 43, - "panels": [], - "title": "Cluster Overview", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "cacheTimeout": null, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Combined current connections", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 5, - "w": 24, - "x": 0, - "y": 5 - }, - "id": 33, - "legend": { - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "connected", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Subscriptions", - "yaxis": 2 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(nats_core_connection_count)", - "format": "time_series", - "instant": false, - "interval": "", - "legendFormat": "Connections", - "refId": "A" - }, - { - "expr": "sum(nats_core_subs_count)", - "instant": false, - "interval": "", - "legendFormat": "Subscriptions", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cluster Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "Connections", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "decimals": null, - "format": "short", - "label": "Subscriptions", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Combined slow consumers detected per second", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 4, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 37, - "legend": { - "avg": false, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(nats_core_slow_consumer_count[1m]))", - "legendFormat": "Slow Consumers", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cluster Slow Consumers", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Combined total messages for all servers", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 12, - "x": 0, - "y": 14 - }, - "id": 31, - "legend": { - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(nats_core_sent_msgs_count[1m]))", - "legendFormat": "Sent", - "refId": "A" - }, - { - "expr": "sum(rate(nats_core_recv_msgs_count[1m]))", - "legendFormat": "Received", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cluster Message Traffic", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "messages / second", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Combined cluster network usage", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 12, - "x": 12, - "y": 14 - }, - "id": 29, - "interval": "", - "legend": { - "alignAsTable": false, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pluginVersion": "6.4.2", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(nats_core_sent_bytes[1m]))", - "legendFormat": "Sent", - "refId": "A" - }, - { - "expr": "sum(rate(nats_core_recv_bytes[1m]))", - "legendFormat": "Received", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cluster Network Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "cacheTimeout": null, - "dashLength": 10, - "dashes": false, - "datasource": null, - "decimals": null, - "description": "Distribution of NATS Server Versions across the cluster", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 5, - "w": 12, - "x": 0, - "y": 20 - }, - "id": 8, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": false, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pluginVersion": "6.4.2", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(nats_core_info) by (server_version)", - "legendFormat": "{{server_version}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Server Versions", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "linear", - "colorScheme": "interpolateYlOrRd", - "exponent": 0.5, - "mode": "opacity" - }, - "dataFormat": "timeseries", - "datasource": null, - "description": "RTT times for the cluster as observed from the Surveyor", - "gridPos": { - "h": 5, - "w": 12, - "x": 12, - "y": 20 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 92, - "interval": "", - "legend": { - "show": false - }, - "options": {}, - "reverseYBuckets": false, - "targets": [ - { - "expr": "nats_core_rtt_nanoseconds", - "format": "time_series", - "instant": false, - "legendFormat": "RTT", - "refId": "A" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Cluster RTT", - "tooltip": { - "show": true, - "showHistogram": true - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ns", - "logBase": 1, - "max": null, - "min": null, - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 25 - }, - "id": 18, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Point in time view of clients connected to each Server", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 6 - }, - "id": 14, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "nats_core_connection_count", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Current Connections", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "current connections", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Number of subscriptions active on the server", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 6 - }, - "id": 20, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "nats_core_subs_count", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Active Subscriptions", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "subscriptions", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Connections received by the server in a second", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 13 - }, - "id": 16, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_total_connection_count[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Connections per second", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "connections / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "The difference in subscription count per minute", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 13 - }, - "id": 22, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": false, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "delta(nats_core_subs_count[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Subscription Delta", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "subscriptions", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Slow consumers detected by each server", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 20 - }, - "id": 41, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_slow_consumer_count[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Slow Consumers", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "slow / second", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Client Connection Detail", - "type": "row" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 71, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Bytes sent for each gateway", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 7 - }, - "id": 72, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_gateway_sent_bytes[1m])", - "legendFormat": "{{server_name}} - {{server_cluster}} -> {{server_gateway_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Gateway Bytes Sent", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": "bytes / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Bytes received for each gateway", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 7 - }, - "id": 73, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_gateway_recv_bytes[1m])", - "legendFormat": "{{server_name}} - {{server_cluster}} -> {{server_gateway_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Gateway Bytes Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": "bytes / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Messages sent for each gateway", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 14 - }, - "id": 74, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_gateway_sent_msgs_count[1m])", - "legendFormat": "{{server_name}} - {{server_cluster}} -> {{server_gateway_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Gateway Messages Sent", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "messages / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Messages received for each gateway", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 14 - }, - "id": 75, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_gateway_recv_msg_count[1m])", - "legendFormat": "{{server_name}} - {{server_cluster}} -> {{server_gateway_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Gateway Messages Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "messages / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Gateway Details", - "type": "row" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 27 - }, - "id": 60, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Bytes sent for each route", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 8 - }, - "id": 62, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_route_sent_bytes[1m])", - "legendFormat": "{{server_name}} - ID {{server_route_id}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Route Bytes Sent", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": "bytes / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Bytes received for each route", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 8 - }, - "id": 63, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_route_recv_bytes[1m])", - "legendFormat": "{{server_name}} - ID {{server_route_id}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Route Bytes Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": "bytes / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Messages sent for each route", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 15 - }, - "id": 64, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_route_sent_msg_count[1m])", - "legendFormat": "{{server_name}} - ID {{server_route_id}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Route Messages Sent", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "messages / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Messages received for each route", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 15 - }, - "id": 65, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_route_recv_msg_count[1m])", - "legendFormat": "{{server_name}} - ID {{server_route_id}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Route Messages Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "messages / sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "The number of servers in each cluster", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 22 - }, - "id": 10, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": false, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(nats_core_info) by (server_cluster)", - "legendFormat": "{{server_cluster}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cluster Size", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "cluster size", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Data in the pending buffers that needs to be sent to remotes", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 22 - }, - "id": 67, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "nats_core_route_pending_bytes", - "legendFormat": "{{server_name}} - {{server_route_id}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Route Pending Data", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Route Details", - "type": "row" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 28 - }, - "id": 24, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Data sent per second", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 26, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_sent_bytes[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Bytes Sent", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Data received per second", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 27, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_recv_bytes[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Bytes Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Messages sent per second", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 16 - }, - "id": 68, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_sent_msgs_count[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Messages Sent", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Messages received per second", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 16 - }, - "id": 69, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_recv_msgs_count[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Messages Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Network Usage Detail", - "type": "row" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 29 - }, - "id": 77, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "description": "CPU used by the NATS Server process", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 10 - }, - "id": 4, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "nats_core_cpu_percentage", - "legendFormat": "{{server_name}}", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "cpu %", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "cpu usage", - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "description": "The number of bytes in use by the NATS server", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 10 - }, - "id": 2, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "nats_core_mem_bytes", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Memory", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": "Bytes", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Node Resource Usage", - "type": "row" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 30 - }, - "id": 84, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "cacheTimeout": null, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "The number of NATS Servers expected to reply vs how many replied during a poll", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 31 - }, - "id": 82, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "max": false, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pluginVersion": "6.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "nats_survey_expected_count", - "legendFormat": "Expected", - "refId": "A" - }, - { - "expr": "nats_survey_surveyed_count", - "legendFormat": "Responded", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Expected vs Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "Expected", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "Responded", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Cluster wide RTT as calculated from the Surveyor", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 5, - "w": 24, - "x": 0, - "y": 38 - }, - "id": 39, - "legend": { - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": false, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(nats_core_rtt_nanoseconds[1m])", - "legendFormat": "{{server_name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cluster RTT", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ns", - "label": "RTT", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Number of times the surveyor reconnected to the network in a minute", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 43 - }, - "id": 90, - "interval": "", - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "increase(nats_survey_nats_reconnects[5m])", - "legendFormat": "Reconnections", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "NATS Reconnects", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Time it takes the surveyor to gather the statistics from surveyed NATS Servers", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 43 - }, - "id": 86, - "legend": { - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": " rate(nats_survey_duration_seconds_sum[5m])\n/\n rate(nats_survey_duration_seconds_count[5m])", - "legendFormat": "Poll Time", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Poll Time", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": "time per poll", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Surveyor", - "type": "row" - } - ], - "refresh": "5s", - "schemaVersion": 20, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": ".+", - "current": { - "text": "All", - "value": "$__all" - }, - "datasource": "Prometheus", - "definition": "label_values(nats_core_info, server_cluster)", - "hide": 0, - "includeAll": true, - "label": "Cluster", - "multi": true, - "name": "cluster", - "options": [], - "query": "label_values(nats_core_info, server_cluster)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": { - "text": "24", - "value": "24" - }, - "datasource": "Prometheus", - "definition": "query_result(nats_survey_expected_count)", - "hide": 2, - "includeAll": false, - "label": null, - "multi": false, - "name": "expected", - "options": [ - { - "selected": true, - "text": "24", - "value": "24" - } - ], - "query": "query_result(nats_survey_expected_count)", - "refresh": 0, - "regex": "/.* ([^\\ ]*) .*/", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-5m", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "NATS Surveyor", - "uid": "nats", - "version": 2 -} \ No newline at end of file diff --git a/setup/grafana/provisioning/dashboards/observations-dashboard.json b/setup/grafana/provisioning/dashboards/observations-dashboard.json deleted file mode 100644 index b8bd15b6..00000000 --- a/setup/grafana/provisioning/dashboards/observations-dashboard.json +++ /dev/null @@ -1,827 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 1, - "id": 3, - "iteration": 1573823403202, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Percentile of service time spent in the service ", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 0 - }, - "id": 14, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "histogram_quantile(0.10, sum(rate(nats_latency_service_duration_bucket{service=~\"${service}\"}[$range])) by (le,service))", - "legendFormat": "{{service}} 10th %", - "refId": "A" - }, - { - "expr": "histogram_quantile(0.50, sum(rate(nats_latency_service_duration_bucket{service=~\"${service}\"}[$range])) by (le,service))", - "legendFormat": "{{service}} 50th %", - "refId": "B" - }, - { - "expr": "histogram_quantile(0.95, sum(rate(nats_latency_service_duration_bucket{service=~\"${service}\"}[$range])) by (le,service))", - "legendFormat": "{{service}} 95th %", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Service Duration Percentiles", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": "duration", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Percentile of total time spent in the service and in the total which includes network overhead ", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 0 - }, - "id": 15, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "histogram_quantile(0.10, sum(rate(nats_latency_total_duration_bucket{service=~\"${service}\"}[$range])) by (le,service))", - "legendFormat": "{{service}} 10th %", - "refId": "A" - }, - { - "expr": "histogram_quantile(0.50, sum(rate(nats_latency_total_duration_bucket{service=~\"${service}\"}[$range])) by (le,service))", - "legendFormat": "{{service}} 50th %", - "refId": "B" - }, - { - "expr": "histogram_quantile(0.95, sum(rate(nats_latency_total_duration_bucket{service=~\"${service}\"}[$range])) by (le,service))", - "legendFormat": "{{service}} 95th %", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Total Duration Percentiles", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": "duration", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Average times taken to serve a request.\n\n* **service time** is the time taken to execute the service\n* **total time** includes network latencies between all parties", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 0 - }, - "id": 2, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(nats_latency_service_duration_sum{service=~\"${service}\"}[$range]) / rate(nats_latency_service_duration_count{service=~\"${service}\"}[$range])) by (service)", - "legendFormat": "{{service}} service time", - "refId": "A" - }, - { - "expr": "sum(rate(nats_latency_total_duration_sum{service=~\"${service}\"}[$range]) / rate(nats_latency_total_duration_count{service=~\"${service}\"}[$range])) by (service)", - "legendFormat": "{{service}} total time", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Average Service Duration", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": "duration", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Time distribution spent traversing the NATS cluster", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 8 - }, - "id": 4, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/10th/", - "color": "#1F60C4" - }, - { - "alias": "/50th/", - "color": "#8AB8FF" - }, - { - "alias": "/95th/", - "color": "#C0D8FF" - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "histogram_quantile(0.10, sum(rate(nats_latency_system_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 10th %", - "refId": "D" - }, - { - "expr": "histogram_quantile(0.50, sum(rate(nats_latency_system_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 50th %", - "refId": "A" - }, - { - "expr": "histogram_quantile(0.95, sum(rate(nats_latency_system_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 95th %", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "System RTT Times Percentiles", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": "rtt time", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Response time distribution between NATS and the Requesting Client", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 8 - }, - "id": 16, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/10th/", - "color": "#3274D9" - }, - { - "alias": "/50th/", - "color": "#8AB8FF" - }, - { - "alias": "/95th/", - "color": "#C0D8FF" - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "histogram_quantile(0.10, sum(rate(nats_latency_requestor_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 10th %", - "refId": "D" - }, - { - "expr": "histogram_quantile(0.50, sum(rate(nats_latency_requestor_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 50th %", - "refId": "A" - }, - { - "expr": "histogram_quantile(0.95, sum(rate(nats_latency_requestor_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 95th %", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Requestor RTT Times Percentiles", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": "rtt time", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Response time distribution between NATS and the Service", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 8 - }, - "id": 17, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/10th/", - "color": "#3274D9" - }, - { - "alias": "/50th/", - "color": "#8AB8FF" - }, - { - "alias": "/95th/", - "color": "#C0D8FF" - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "histogram_quantile(0.10, sum(rate(nats_latency_responder_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 10th %", - "refId": "D" - }, - { - "expr": "histogram_quantile(0.50, sum(rate(nats_latency_responder_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 50th %", - "refId": "A" - }, - { - "expr": "histogram_quantile(0.95, sum(rate(nats_latency_responder_rtt_bucket{service=~\"${service}\"}[$range])) by (service, le))", - "legendFormat": "{{service}} 95th %", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Responder RTT Times Percentiles", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": "rtt time", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Number of observations received", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 16 - }, - "id": 6, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(nats_latency_observation_count{service=~\"${service}\"}[$range])) by (service)", - "legendFormat": "{{service}} observations", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Observations Received", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "observations / second", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "10s", - "schemaVersion": 20, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": ".+", - "current": { - "text": "All", - "value": [ - "$__all" - ] - }, - "datasource": "Prometheus", - "definition": "label_values(nats_latency_total_duration_sum, service)", - "hide": 0, - "includeAll": true, - "label": "Service", - "multi": true, - "name": "service", - "options": [], - "query": "label_values(nats_latency_total_duration_sum, service)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "auto": false, - "auto_count": 30, - "auto_min": "10s", - "current": { - "text": "1m", - "value": "1m" - }, - "hide": 0, - "label": "Range", - "name": "range", - "options": [ - { - "selected": true, - "text": "1m", - "value": "1m" - }, - { - "selected": false, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - } - ], - "query": "1m,5m,10m", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Service Observations", - "uid": "latency", - "version": 61 -} diff --git a/setup/grafana/provisioning/datasources/all.yml b/setup/grafana/provisioning/datasources/all.yml deleted file mode 100644 index 60f125af..00000000 --- a/setup/grafana/provisioning/datasources/all.yml +++ /dev/null @@ -1,12 +0,0 @@ -# config file version -apiVersion: 1 - -datasources: -- name: Prometheus - type: prometheus - access: proxy - orgId: 1 - url: 'http://nats-surveyor-prometheus:9090' - isDefault: true - version: 1 - editable: true diff --git a/setup/nats-setup.sh b/setup/nats-setup.sh deleted file mode 100755 index 83699d9c..00000000 --- a/setup/nats-setup.sh +++ /dev/null @@ -1,378 +0,0 @@ -#!/bin/sh - -set -eu - -VERSION="0.2.2" - -NATS_K8S_COMMIT=93c2a213bd26791fda29da2b7238e3f3b1ca36e1 - -NATS_K8S_VERSION=https://raw.githubusercontent.com/nats-io/k8s/$NATS_K8S_COMMIT - -NATS_SERVER_YML=${DEFAULT_NATS_SERVER_YML:=$NATS_K8S_VERSION/nats-server/nats-server-with-auth.yml} - -NATS_SERVER_TLS_YML=${DEFAULT_NATS_SERVER_TLS_YML:=$NATS_K8S_VERSION/nats-server/nats-server-with-auth-and-tls.yml} - -NATS_SERVER_INSECURE_YML=${DEFAULT_NATS_SERVER_INSECURE_YML:=$NATS_K8S_VERSION/nats-server/nats-server-plain.yml} - -PROMETHEUS_OPERATOR_YML=${DEFAULT_PROMETHEUS_OPERATOR_YML:=$NATS_K8S_VERSION/tools/prometheus-operator.yml} - -NATS_PROMETHEUS_YML=${DEFAULT_NATS_PROMETHEUS_YML:=$NATS_K8S_VERSION/tools/nats-prometheus.yml} - -NATS_GRAFANA_YML=${DEFAULT_NATS_GRAFANA_YML:=$NATS_K8S_VERSION/tools/nats-surveyor-grafana.yml} - -CERT_MANAGER_YML=${DEFAULT_CERT_MANAGER_YML:=$NATS_K8S_VERSION/nats-server/nats-certs.yml} -CERT_MANAGER_RELEASE_YML=${DEFAULT_CERT_MANAGER_RELEASE_YML:=https://github.com/jetstack/cert-manager/releases/download/v0.11.0/cert-manager.yaml} - -# With certs and creds, just auth no TLS, and plain examples. -NATS_BOX_AUTH_TLS_YML=${DEFAULT_NATS_BOX_AUTH_TLS_YML:=$NATS_K8S_VERSION/tools/nats-box-tls.yml} -NATS_BOX_AUTH_YML=${DEFAULT_NATS_BOX_AUTH_YML:=$NATS_K8S_VERSION/tools/nats-box-auth.yml} -NATS_BOX_YML=${DEFAULT_NATS_BOX_YML:=$NATS_K8S_VERSION/tools/nats-box.yml} - -NATS_SURVEYOR_TLS_YML=${DEFAULT_NATS_SURVEYOR_TLS_YML:=$NATS_K8S_VERSION/tools/nats-surveyor-tls.yml} -NATS_SURVEYOR_YML=${DEFAULT_NATS_SURVEYOR_YML:=$NATS_K8S_VERSION/tools/nats-surveyor.yml} - -NATS_STREAMING_AUTH_TLS_YML=${DEFAULT_NATS_STREAMING_AUTH_TLS_YML:=$NATS_K8S_VERSION/nats-streaming-server/nats-streaming-auth-and-tls.yml} -NATS_STREAMING_AUTH_YML=${DEFAULT_NATS_STREAMING_AUTH_YML:=$NATS_K8S_VERSION/nats-streaming-server/nats-streaming-auth.yml} - -NSC_DIR=${DEFAULT_NSC_DIR:=$(pwd)/nsc} - -SKIP_NSC_DIR_CHOWN=${DEFAULT_SKIP_NSC_DIR_CHOWN:=false} - -NATS_NAMESPACE="" - -export NATS_CONFIG_HOME=$NSC_DIR/config - -export NKEYS_PATH=$NSC_DIR/nkeys - -export NSC_HOME=$NSC_DIR/accounts - -kctl() { - i=0 - until [ $i -ge 10 ] - do - kubectl ${NATS_NAMESPACE:+"-n" "$NATS_NAMESPACE"} "$@" && break - i=$((i+1)) - - if [ "$i" -ge 2 ]; then - echo -ne "Retrying in 3 seconds ($i attempts so far)" - else - echo -ne "Retrying in 3 seconds" - fi - - sleep 1 - echo -ne '.' - sleep 1 - echo -ne '.' - sleep 1 - echo -ne '.' - echo - done - - if [ "$i" -ge 10 ]; then - RED='\033[0;31m' - NC='\033[0m' - echo -ne "${RED}Could not finish setting up NATS due to errors in the cluster${NC}" - echo - exit 1 - fi -} - -create_creds() { - # Run NSC setup script that should be local to the setup. - . nsc-setup.sh - - # Generate accounts resolver config using the preload config - ( - mkdir -p "$NATS_CONFIG_HOME" - cd "$NATS_CONFIG_HOME" - nsc generate config --mem-resolver --sys-account SYS > resolver.conf - ) - - if [ $SKIP_NSC_DIR_CHOWN != "true" ]; then - chown -R 1000:1000 "$NSC_DIR" - fi -} - -create_secrets() { - kctl create secret generic nats-sys-creds --from-file "$NSC_DIR/nkeys/creds/KO/SYS/sys.creds" - kctl create secret generic nats-test-creds --from-file "$NSC_DIR/nkeys/creds/KO/A/test.creds" - kctl create secret generic nats-test2-creds --from-file "$NSC_DIR/nkeys/creds/KO/B/test.creds" - kctl create secret generic stan-creds --from-file "$NSC_DIR/nkeys/creds/KO/STAN/stan.creds" - kctl create configmap nats-accounts --from-file "$NSC_DIR/config/resolver.conf" -} - -install_prometheus() { - # Install Prometheus Operator - kubectl apply --validate=false --filename $PROMETHEUS_OPERATOR_YML - - # Create Prometheus instance for NATS usage - kctl apply --filename $NATS_PROMETHEUS_YML -} - -install_nats_surveyor_components() { - install_prometheus - - # Deploy NATS Surveyor Grafana instance - kctl apply --filename $NATS_GRAFANA_YML -} - -install_nats_surveyor_with_tls() { - kctl apply --filename $NATS_SURVEYOR_TLS_YML -} - -install_nats_surveyor() { - kctl apply --filename $NATS_SURVEYOR_YML -} - -install_nats_server_with_auth() { - kctl apply --filename $NATS_SERVER_YML -} - -install_nats_server_with_auth_and_tls() { - kctl apply --filename $CERT_MANAGER_YML - kctl apply --filename $NATS_SERVER_TLS_YML -} - -install_insecure_nats_server() { - kctl apply --filename $NATS_SERVER_INSECURE_YML -} - -install_cert_manager() { - kubectl get ns cert-manager > /dev/null 2> /dev/null || { - kubectl create namespace cert-manager - } - - kubectl apply --validate=false -f $CERT_MANAGER_RELEASE_YML -} - -install_nats_box_with_auth_and_tls() { - kctl apply -f $NATS_BOX_AUTH_TLS_YML -} - -install_nats_box_with_auth() { - kctl apply -f $NATS_BOX_AUTH_YML -} - -install_nats_box() { - kctl apply -f $NATS_BOX_YML -} - -install_nats_streaming_with_auth_and_tls() { - kctl apply -f $NATS_STREAMING_AUTH_TLS_YML -} - -install_nats_streaming_with_auth() { - kctl apply -f $NATS_STREAMING_AUTH_YML -} - -show_usage() { - echo "Usage: $0 [options] - - -n, --namespace Setup the cluster in the specified namespace - --without-tls Setup the cluster without TLS enabled - --without-auth Setup the cluster in insecure mode (also disables TLS) - --without-surveyor Skips installing NATS surveyor - --without-cert-manager Skips installing the cert manager component - --without-nats-streaming Setup the cluster without NATS Streaming -" -} - -show_version() { - echo "$0 v$VERSION ($NATS_K8S_COMMIT)" -} - -main() { - with_surveyor=true - with_tls=true - with_auth=true - with_cert_manager=true - with_stan=true - - while [ ! $# -eq 0 ]; do - case $1 in - -v) - show_version - exit 0 - ;; - -h) - show_usage - exit 0 - ;; - -n|--namespace) - NATS_NAMESPACE="$2" - shift - ;; - --without-surveyor) - # In case of deploying multiple clusters, only need a single instance. - with_surveyor=false - ;; - --without-tls) - with_tls=false - with_cert_manager=false - ;; - --without-cert-manager) - # In case cert manager has already been installed. - with_cert_manager=false - ;; - --without-auth) - with_auth=false - - # Surveyor and NATS Streaming both require auth. - with_surveyor=false - with_stan=false - with_tls=false - with_cert_manager=false - ;; - --without-nats-streaming) - with_stan=false - ;; - --without-stan) - with_stan=false - ;; - *) - echo "unknown flag: $1" - show_usage - exit 1 - ;; - esac - shift - done - - CYAN='\033[0;36m' - NC='\033[0m' - echo -e "${CYAN}" - echo "##############################################" - echo "# #" - echo "# _ _ _ _____ ____ _ _____ ____ #" - echo "# | \ | | / \|_ _/ ___| | |/ ( _ ) ___| #" - echo "# | \| | / _ \ | | \___ \ | ' // _ \___ \ #" - echo "# | |\ |/ ___ \| | ___) || . \ (_) |__) | #" - echo "# |_| \_/_/ \_\_| |____(_)_|\_\___/____/ #" - echo "# #" - echo "# nats-setup (v$VERSION) #" - echo "##############################################" - echo - echo " +---------------------+---------------------+" - echo " | OPTIONS |" - echo " +---------------------+---------------------+" - echo " nats server | true " - echo " nats surveyor | $with_surveyor " - echo " nats tls | $with_tls " - echo " enable auth | $with_auth " - echo " install cert_manager | $with_cert_manager " - echo " nats streaming | $with_stan " - echo " +-------------------------------------------+" - echo " | |" - echo " | Starting setup... |" - echo " | |" - echo " +-------------------------------------------+" - echo - echo -e "${NC}" - - if [ $with_auth = true ]; then - # Skip if directory already exists - [ ! -d "$NSC_DIR" ] && create_creds - create_secrets - fi - - if [ $with_cert_manager = true ]; then - install_cert_manager - fi - - if [ $with_tls = true ] && [ $with_auth = true ]; then - install_nats_server_with_auth_and_tls - install_nats_box_with_auth_and_tls - - if [ $with_stan = true ]; then - install_nats_streaming_with_auth_and_tls - fi - elif [ $with_auth = true ]; then - install_nats_server_with_auth - install_nats_box_with_auth - - if [ $with_stan = true ]; then - install_nats_streaming_with_auth - fi - else - install_insecure_nats_server - install_nats_box - fi - - if [ $with_surveyor = true ]; then - install_nats_surveyor_components - if [ $with_tls = true ]; then - install_nats_surveyor_with_tls - else - install_nats_surveyor - fi - fi - kctl wait --for=condition=Ready pod/nats-0 --timeout=60s - kctl wait --for=condition=Ready pod/nats-box --timeout=60s - - echo -e "${CYAN}" - echo " +------------------------------------------+" - echo " | |" - echo " | Done. Enjoy your new NATS cluster! |" - echo " | |" - echo " +------------------------------------------+" - echo -e "${NC}" - echo "=== Getting started" - echo - echo "You can now start receiving and sending messages using " - echo "the nats-box instance deployed into your namespace:" - echo - echo -e " ${CYAN}kubectl${NATS_NAMESPACE:+ -n $NATS_NAMESPACE} exec -it nats-box -- /bin/sh -l ${NC}" - echo - if [ $with_auth = true ]; then - echo "Using the test account user:" - echo -e " ${CYAN}" - echo " nats-sub test &" - echo " nats-pub test 'Hello World'" - echo -e " ${NC}" - - echo "Or try using the system account user to inspect all events in the cluster:" - echo -e " ${CYAN}" - echo " nats-sub -creds /var/run/nats/creds/sys/sys.creds '>'" - echo -e " ${NC}" - - echo "To create a sample service and a requestor, tracking service latency:" - echo -e " ${CYAN}" - echo " nats-rply test 'I can help!' &" - echo " nats-sub latency.on.test &" - echo " nats-req test 'help!'" - echo -e " ${NC}" - else - echo -ne " ${CYAN}" - echo " nats-sub test &" - echo " nats-pub test 'Hello World'" - echo -e " ${NC}" - fi - echo "The nats-box also includes nats-top which you can use to" - echo "inspect the flow of messages from one of the members" - echo "of the cluster (press 'q' to exit)." - echo - echo -e " ${CYAN}nats-top${NC}" - echo - - if [ $with_stan = true ]; then - echo "NATS Streaming with persistence is also available as part of your cluster." - echo "It is installed under the STAN account so you can use the following credentials:" - echo -e " ${CYAN}" - echo " stan-pub test 'Hello World'" - echo " stan-sub test -all" - echo -e " ${NC}" - fi - - if [ $with_surveyor = true ]; then - echo "You can also connect to your monitoring dashboard:" - echo -e " ${CYAN}" - echo " kubectl${NATS_NAMESPACE:+ -n $NATS_NAMESPACE} port-forward deployments/nats-surveyor-grafana 3000:3000" - echo -e " ${NC}" - echo "Then open the following in your browser:" - echo -e " ${CYAN}" - echo " http://127.0.0.1:3000/d/nats/nats-surveyor?refresh=5s&orgId=1" - echo -e " ${NC}" - fi -} - -main "$@" diff --git a/setup/nsc-setup.sh b/setup/nsc-setup.sh deleted file mode 100755 index 24aeeabe..00000000 --- a/setup/nsc-setup.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -[ -z "$NKEYS_PATH" ] && { - export NKEYS_PATH=$(pwd)/nsc/nkeys -} - -[ -z "$NSC_HOME" ] && { - export NSC_HOME=$(pwd)/nsc/accounts -} - -if [ ! -f .nsc.env ]; then - echo ' -# NSC Environment Setup -export NKEYS_PATH=$(pwd)/nsc/nkeys -export NSC_HOME=$(pwd)/nsc/accounts -' > .nsc.env -fi - -mkdir -p "$NKEYS_PATH" -mkdir -p "$NSC_HOME" -nsc add operator --name KO - -# Create system account -nsc add account --name SYS -nsc add user --name sys - -# Create a couple of accounts (A & B) for testing purposes. -nsc add account --name A -nsc add user -a A \ - --name test \ - --allow-pubsub 'test.>' \ - --allow-pubsub 'test' \ - --allow-pubsub '_INBOX.>' \ - --allow-pubsub '_R_' \ - --allow-pubsub '_R_.>' \ - --allow-sub latency.on.test - -# Add latency exporting for the test subject from account A. -nsc add export -a A --latency latency.on.test --sampling 100 --service -s test - -# Add account B that imports services from A. -nsc add account --name B -nsc add user -a B \ - --name test \ - --allow-pubsub 'test.>' \ - --allow-pubsub 'test' \ - --allow-pubsub '_INBOX.>' \ - --allow-pubsub '_R_' \ - --allow-pubsub '_R_.>' - -nsc add import --account B \ - --src-account $(nsc list accounts 2>&1 | awk '$2 == "A" {print $0}' | awk '{print $4}') \ - --remote-subject test --service --local-subject test - -# Create account for STAN purposes. -nsc add account --name STAN -nsc add user --name stan diff --git a/tools/nats-box-auth.yml b/tools/nats-box-auth.yml deleted file mode 100644 index 8a48c9fa..00000000 --- a/tools/nats-box-auth.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: nats-box - labels: - app: nats-box -spec: - volumes: - - name: syscreds-volume - secret: - secretName: nats-sys-creds - - name: creds-volume - secret: - secretName: nats-test-creds - - name: creds2-volume - secret: - secretName: nats-test2-creds - - name: stan-creds-volume - secret: - secretName: stan-creds - containers: - - name: nats-box - image: synadia/nats-box:latest - imagePullPolicy: Always - env: - - name: NATS_URL - value: nats - - name: STAN_CLUSTER - value: stan - - name: STAN_CREDS - value: /var/run/nats/creds/stan/stan.creds - - name: USER_CREDS - value: /var/run/nats/creds/test/test.creds - - name: USER2_CREDS - value: /var/run/nats/creds/test2/test.creds - command: - - "tail" - - "-f" - - "/dev/null" - volumeMounts: - - name: syscreds-volume - mountPath: /var/run/nats/creds/sys - - name: creds-volume - mountPath: /var/run/nats/creds/test - - name: creds2-volume - mountPath: /var/run/nats/creds/test2 - - name: stan-creds-volume - mountPath: /var/run/nats/creds/stan diff --git a/tools/nats-box-tls.yml b/tools/nats-box-tls.yml deleted file mode 100644 index df0cdda0..00000000 --- a/tools/nats-box-tls.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: nats-box - labels: - app: nats-box -spec: - volumes: - - name: syscreds-volume - secret: - secretName: nats-sys-creds - - name: creds-volume - secret: - secretName: nats-test-creds - - name: creds2-volume - secret: - secretName: nats-test2-creds - - name: stan-creds-volume - secret: - secretName: stan-creds - - name: nats-client-tls-volume - secret: - secretName: nats-server-tls - containers: - - name: nats-box - image: synadia/nats-box:latest - imagePullPolicy: Always - - env: - - name: NATS_URL - value: nats - - name: STAN_CLUSTER - value: stan - - name: STAN_CREDS - value: /var/run/nats/creds/stan/stan.creds - - name: USER_CREDS - value: /var/run/nats/creds/test/test.creds - - name: USER2_CREDS - value: /var/run/nats/creds/test2/test.creds - lifecycle: - postStart: - exec: - command: - - /bin/sh - - -c - - cp /etc/nats/certs/ca.crt /usr/local/share/ca-certificates && update-ca-certificates - command: - - "tail" - - "-f" - - "/dev/null" - volumeMounts: - - name: syscreds-volume - mountPath: /var/run/nats/creds/sys - - name: creds-volume - mountPath: /var/run/nats/creds/test - - name: creds2-volume - mountPath: /var/run/nats/creds/test2 - - name: stan-creds-volume - mountPath: /var/run/nats/creds/stan - - name: nats-client-tls-volume - mountPath: /etc/nats/certs diff --git a/tools/nats-box.yml b/tools/nats-box.yml deleted file mode 100644 index ebf00e2f..00000000 --- a/tools/nats-box.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: nats-box - labels: - app: nats-box -spec: - containers: - - name: nats-box - image: synadia/nats-box:latest - imagePullPolicy: Always - env: - - name: NATS_URL - value: nats - - name: STAN_CLUSTER - value: stan - command: - - "tail" - - "-f" - - "/dev/null" diff --git a/tools/nats-prometheus.yml b/tools/nats-prometheus.yml deleted file mode 100644 index 515c9826..00000000 --- a/tools/nats-prometheus.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -# Service for data from prometheus exporters per NATS Server -apiVersion: v1 -kind: Service -metadata: - name: nats-prometheus -spec: - selector: - prometheus: nats-prometheus - clusterIP: None - ports: - - name: web - port: 9090 - protocol: TCP - targetPort: web ---- -apiVersion: monitoring.coreos.com/v1 -kind: Prometheus -metadata: - name: nats-prometheus -spec: - scrapeInterval: "5s" - serviceAccountName: prometheus - serviceMonitorSelector: - matchLabels: - app: nats - resources: - requests: - memory: 400Mi - enableAdminAPI: true ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: nats - labels: - app: nats -spec: - selector: - matchLabels: - app: nats - endpoints: - - port: metrics diff --git a/tools/nats-surveyor-grafana.yml b/tools/nats-surveyor-grafana.yml deleted file mode 100644 index 58afedd4..00000000 --- a/tools/nats-surveyor-grafana.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: grafana -spec: - type: NodePort - selector: - app: nats-surveyor-grafana - ports: - - name: web - # nodePort: 30300 - port: 3000 - protocol: TCP - targetPort: web ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nats-surveyor-grafana - labels: - app: nats-surveyor-grafana -spec: - selector: - matchLabels: - app: nats-surveyor-grafana - replicas: 1 - template: - metadata: - labels: - app: nats-surveyor-grafana - spec: - containers: - - name: nats-surveyor-grafana - image: connecteverything/nats-surveyor-grafana:0.1.1 - imagePullPolicy: Always - env: - - name: GF_AUTH_ANONYMOUS_ENABLED - value: "true" - - name: GF_AUTH_ANONYMOUS_ORG_ROLE - value: "Admin" - - name: GF_AUTH_DISABLE_LOGIN_FORM - value: "true" - - ports: - - containerPort: 3000 - name: web - - # Disable all cpu limits for the server. - # - resources: - requests: - cpu: 0 diff --git a/tools/prometheus-operator.yml b/tools/prometheus-operator.yml deleted file mode 100644 index d9e783ff..00000000 --- a/tools/prometheus-operator.yml +++ /dev/null @@ -1,207 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.30.0 - name: prometheus-operator -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: prometheus-operator -subjects: -- kind: ServiceAccount - name: prometheus-operator - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.30.0 - name: prometheus-operator -rules: -- apiGroups: - - apiextensions.k8s.io - resources: - - customresourcedefinitions - verbs: - - '*' -- apiGroups: - - monitoring.coreos.com - resources: - - alertmanagers - - prometheuses - - prometheuses/finalizers - - alertmanagers/finalizers - - servicemonitors - - podmonitors - - prometheusrules - verbs: - - '*' -- apiGroups: - - apps - resources: - - statefulsets - verbs: - - '*' -- apiGroups: - - "" - resources: - - configmaps - - secrets - verbs: - - '*' -- apiGroups: - - "" - resources: - - pods - verbs: - - list - - delete -- apiGroups: - - "" - resources: - - services - - services/finalizers - - endpoints - verbs: - - get - - create - - update - - delete -- apiGroups: - - "" - resources: - - nodes - verbs: - - list - - watch -- apiGroups: - - "" - resources: - - namespaces - verbs: - - get - - list - - watch ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.30.0 - name: prometheus-operator - namespace: default -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator - template: - metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.30.0 - spec: - containers: - - args: - - --kubelet-service=kube-system/kubelet - - --logtostderr=true - - --config-reloader-image=quay.io/coreos/configmap-reload:v0.0.1 - - --prometheus-config-reloader=quay.io/coreos/prometheus-config-reloader:v0.30.0 - image: quay.io/coreos/prometheus-operator:v0.30.0 - name: prometheus-operator - ports: - - containerPort: 8080 - name: http - resources: - limits: - cpu: 200m - memory: 200Mi - requests: - cpu: 100m - memory: 100Mi - securityContext: - allowPrivilegeEscalation: false - readOnlyRootFilesystem: true - nodeSelector: - beta.kubernetes.io/os: linux - securityContext: - runAsNonRoot: true - runAsUser: 65534 - serviceAccountName: prometheus-operator ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.30.0 - name: prometheus-operator - namespace: default ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.30.0 - name: prometheus-operator - namespace: default -spec: - clusterIP: None - ports: - - name: http - port: 8080 - targetPort: http - selector: - app.kubernetes.io/component: controller - app.kubernetes.io/name: prometheus-operator ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: prometheus ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - name: prometheus -rules: -- apiGroups: [""] - resources: - - nodes - - services - - endpoints - - pods - verbs: ["get", "list", "watch"] -- apiGroups: [""] - resources: - - configmaps - verbs: ["get"] -- nonResourceURLs: ["/metrics"] - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: prometheus -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: prometheus -subjects: -- kind: ServiceAccount - name: prometheus - namespace: default