nats
by KubeGems
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 repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/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.12+
- Helm 3.1.0
Installing the Chart
To install the chart with the release name my-release:
$ helm install my-release bitnami/nats
The command deploys NATS on the Kubernetes cluster in the default configuration. The Parameters 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.
Parameters
The following tables lists the configurable parameters of the NATS chart and their default values per section/component:
Global parameters
| 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) |
Common parameters
| Parameter | Description | Default |
|---|---|---|
nameOverride | String to partially override common.names.fullname | nil |
fullnameOverride | String to fully override common.names.fullname | nil |
commonLabels | Labels to add to all deployed objects | {} |
commonAnnotations | Annotations to add to all deployed objects | {} |
clusterDomain | Default Kubernetes cluster domain | cluster.local |
extraDeploy | Array of extra objects to deploy with the release | [] (evaluated as a template) |
kubeVersion | Force target Kubernetes version (using Helm capabilities if not set) | nil |
NATS parameters
| Parameter | Description | Default |
|---|---|---|
image.registry | NATS image registry | docker.io |
image.repository | NATS image name | bitnami/nats |
image.tag | NATS image tag | {TAG_NAME} |
image.pullPolicy | Image pull policy | IfNotPresent |
image.pullSecrets | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
hostAliases | Add deployment host aliases | [] |
auth.enabled | Switch to enable/disable client authentication | true |
auth.user | Client authentication user | nats_client |
auth.password | Client authentication password | random alhpanumeric string (10) |
auth.token | Client authentication token | nil |
auth.timeout | Client authentication timeout (seconds) | 1 |
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 |
natsFilename | Filename used by several NATS files (binary, configurarion file, and pid file) | nats-server |
command | Override default container command (useful when using custom images) | nil |
args | Override default container args (useful when using custom images) | nil |
metrics.kafka.extraFlags | Extra flags to be passed to NATS | {} |
extraEnvVars | Extra environment variables to be set on NATS container | {} |
extraEnvVarsCM | Name of existing ConfigMap containing extra env vars | nil |
extraEnvVarsSecret | Name of existing Secret containing extra env vars | nil |
NATS deployment/statefulset parameters
| Parameter | Description | Default |
|---|---|---|
resourceType | NATS cluster resource type under Kubernetes (Supported: StatefulSets, or Deployment) | statefulset |
replicaCount | Number of NATS nodes | 1 |
schedulerName | Name of an alternate | nil |
priorityClassName | Name of pod priority class | nil |
podSecurityContext | NATS pods' Security Context | Check values.yaml file |
updateStrategy | Strategy to use to update Pods | Check values.yaml file |
containerSecurityContext | NATS containers' Security Context | Check values.yaml file |
resources.limits | The resources limits for the NATS container | {} |
resources.requests | The requested resources for the NATS container | {} |
livenessProbe | Liveness probe configuration for NATS | Check values.yaml file |
readinessProbe | Readiness probe configuration for NATS | Check values.yaml file |
customLivenessProbe | Override default liveness probe | nil |
customReadinessProbe | Override default readiness probe | nil |
podAffinityPreset | Pod affinity preset. Ignored if affinity is set. Allowed values: soft or hard | "" |
podAntiAffinityPreset | Pod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hard | soft |
nodeAffinityPreset.type | Node affinity preset type. Ignored if affinity is set. Allowed values: soft or hard | "" |
nodeAffinityPreset.key | Node label key to match. Ignored if affinity is set. | "" |
nodeAffinityPreset.values | Node label values to match. Ignored if affinity is set. | [] |
affinity | Affinity for pod assignment | {} (evaluated as a template) |
nodeSelector | Node labels for pod assignment | {} (evaluated as a template) |
tolerations | Tolerations for pod assignment | [] (evaluated as a template) |
podLabels | Extra labels for NATS pods | {} (evaluated as a template) |
podAnnotations | Annotations for NATS pods | {} (evaluated as a template) |
extraVolumeMounts | Optionally specify extra list of additional volumeMounts for NATS container(s) | [] |
extraVolumes | Optionally specify extra list of additional volumes for NATS pods | [] |
initContainers | Add additional init containers to the NATS pods | {} (evaluated as a template) |
sidecars | Add additional sidecar containers to the NATS pods | {} (evaluated as a template) |
Exposure parameters
| Parameter | Description | Default |
|---|---|---|
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 |
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 v6.3.10 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