nats
An open-source, cloud-native messaging system
About this chart
NATS
NATS is an open-source, cloud-native messaging system. It provides a lightweight server that is written in the Go programming language.
TL;DR
$ helm install <helm-repo>/nats
$ helm install stable/nats
Introduction
This chart bootstraps a NATS deployment on a Kubernetes cluster using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This chart has been tested to work with NGINX Ingress, cert-manager, fluentd and Prometheus on top of the BKPR.
Prerequisites
- Kubernetes 1.4+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name my-release:
$ helm install --name my-release <helm-repo>/nats
$ helm install --name my-release stable/nats The command deploys NATS on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Configuration
The following table lists the configurable parameters of the NATS chart and their default values.
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker image registry | nil |
global.imagePullSecrets | Global Docker registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
image.registry | NATS image registry | docker.io |
image.repository | NATS Image name | bitnami/nats |
image.tag | NATS Image tag | {VERSION} |
image.pullPolicy | Image pull policy | Always |
image.pullSecrets | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
auth.enabled | Switch to enable/disable client authentication | true |
auth.user | Client authentication user | nats_cluster |
auth.password | Client authentication password | random alhpanumeric string (10) |
auth.token | Client authentication token | nil |
clusterAuth.enabled | Switch to enable/disable cluster authentication | true |
clusterAuth.user | Cluster authentication user | nats_cluster |
clusterAuth.password | Cluster authentication password | random alhpanumeric string (10) |
clusterAuth.token | Cluster authentication token | nil |
debug.enabled | Switch to enable/disable debug on logging | false |
debug.trace | Switch to enable/disable trace debug level on logging | false |
debug.logtime | Switch to enable/disable logtime on logging | false |
maxConnections | Max. number of client connections | nil |
maxControlLine | Max. protocol control line | nil |
maxPayload | Max. payload | nil |
writeDeadline | Duration the server can block on a socket write to a client | nil |
replicaCount | Number of NATS nodes | 1 |
resourceType | NATS cluster resource type under Kubernetes (Supported: StatefulSets, or Deployment) | statefulset |
securityContext.enabled | Enable security context | true |
securityContext.fsGroup | Group ID for the container | 1001 |
securityContext.runAsUser | User ID for the container | 1001 |
statefulset.updateStrategy | Statefulsets Update strategy | OnDelete |
statefulset.rollingUpdatePartition | Partition for Rolling Update strategy | nil |
podLabels | Additional labels to be added to pods | {} |
priorityClassName | Name of pod priority class | nil |
podAnnotations | Annotations to be added to pods | {} |
nodeSelector | Node labels for pod assignment | nil |
schedulerName | Name of an alternate | nil |
antiAffinity | Anti-affinity for pod assignment | soft |
tolerations | Toleration labels for pod assignment | nil |
resources | CPU/Memory resource requests/limits | {} |
extraArgs | Optional flags for NATS | [] |
livenessProbe.initialDelaySeconds | Delay before liveness probe is initiated | 30 |
livenessProbe.periodSeconds | How often to perform the probe | 10 |
livenessProbe.timeoutSeconds | When the probe times out | 5 |
livenessProbe.successThreshold | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 |
livenessProbe.failureThreshold | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 |
readinessProbe.initialDelaySeconds | Delay before readiness probe is initiated | 5 |
readinessProbe.periodSeconds | How often to perform the probe | 10 |
readinessProbe.timeoutSeconds | When the probe times out | 5 |
readinessProbe.failureThreshold | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 |
readinessProbe.successThreshold | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 |
client.service.type | Kubernetes Service type (NATS client) | ClusterIP |
client.service.port | NATS client port | 4222 |
client.service.nodePort | Port to bind to for NodePort service type (NATS client) | nil |
client.service.annotations | Annotations for NATS client service | {} |
client.service.loadBalancerIP | loadBalancerIP if NATS client service type is LoadBalancer | nil |
cluster.service.type | Kubernetes Service type (NATS cluster) | ClusterIP |
cluster.service.port | NATS cluster port | 6222 |
cluster.service.nodePort | Port to bind to for NodePort service type (NATS cluster) | nil |
cluster.service.annotations | Annotations for NATS cluster service | {} |
cluster.service.loadBalancerIP | loadBalancerIP if NATS cluster service type is LoadBalancer | nil |
monitoring.service.type | Kubernetes Service type (NATS monitoring) | ClusterIP |
monitoring.service.port | NATS monitoring port | 8222 |
| ` |
Deploy nats with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nats on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnats is pinned at v2.5.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply