nats

by [riftbit]

Helm chartv6.4.8App 2.6.1Verified publisher

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

Global parameters

NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]

Common parameters

NameDescriptionValue
kubeVersionForce target Kubernetes version (using Helm capabilities if not set)""
nameOverrideString to partially override common.names.fullname template (will maintain the release name)""
fullnameOverrideString to fully override common.names.fullname template""
commonLabelsAdd labels to all the deployed resources{}
commonAnnotationsAdd annotations to all the deployed resources{}
clusterDomainKubernetes Cluster Domaincluster.local
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the deployment["sleep"]
diagnosticMode.argsArgs to override all containers in the deployment["infinity"]

NATS parameters

NameDescriptionValue
image.registryNATS image registrydocker.io
image.repositoryNATS image repositorybitnami/nats
image.tagNATS image tag (immutable tags are recommended)2.6.1-debian-10-r0
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[]
auth.enabledSwitch to enable/disable client authenticationtrue
auth.userClient authentication usernats_client
auth.passwordClient authentication password""
auth.tokenClient authentication token""
auth.timeoutClient authentication timeout (seconds)1
clusterAuth.enabledSwitch to enable/disable cluster authenticationtrue
clusterAuth.userCluster authentication usernats_cluster
clusterAuth.passwordCluster authentication password""
clusterAuth.tokenCluster authentication token""
debug.enabledSwitch to enable/disable debug on loggingfalse
debug.traceSwitch to enable/disable trace debug level on loggingfalse
debug.logtimeSwitch to enable/disable logtime on loggingfalse
maxConnectionsMax. number of client connections""
maxControlLineMax. protocol control line""
maxPayloadMax. payload""
writeDeadlineDuration the server can block on a socket write to a client""
natsFilenameFilename used by several NATS files (binary, configurarion file, and pid file)nats-server
commandOverride default container command (useful when using custom images)[]
argsOverride default container args (useful when using custom images)[]
hostAliasesDeployment pod host aliases[]
extraFlagsExtra flags to be passed to NATS{}
extraEnvVarsExtra environment variables to be set on NATS container[]
extraEnvVarsCMConfigMap with extra environment variables""
extraEnvVarsSecretSecret with extra environment variables""

NATS deployment/statefulset parameters

NameDescriptionValue
resourceTypeNATS cluster resource type under Kubernetes. Allowed values: statefulset (default) or deploymentstatefulset
replicaCountNumber of NATS nodes1
schedulerNameUse an alternate scheduler, e.g. "stork".""
priorityClassNameName of pod priority class""
updateStrategy.typeStrategyType. Can be set to RollingUpdate or OnDeleteRollingUpdate
podSecurityContextNATS pods' Security Context{}
containerSecurityContextNATS containers' Security Context{}
resources.limitsThe resources limits for the NATS container{}
resources.requestsThe requested resources for the NATS container{}
livenessProbe.enabledEnable livenessProbetrue
livenessProbe.httpGet.pathRequest path for livenessProbe/
livenessProbe.httpGet.portPort for livenessProbemonitoring
livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe30
livenessProbe.periodSecondsPeriod seconds for livenessProbe10
livenessProbe.timeoutSecondsTimeout seconds for livenessProbe5
livenessProbe.failureThresholdFailure threshold for livenessProbe6
livenessProbe.successThresholdSuccess threshold for livenessProbe1
readinessProbe.enabledEnable readinessProbetrue
readinessProbe.httpGet.pathRequest path for readinessProbe/
readinessProbe.httpGet.portPort for readinessProbemonitoring
readinessProbe.initialDelaySecondsInitial delay seconds for readinessProbe5
readinessProbe.periodSecondsPeriod seconds for readinessProbe10
readinessProbe.timeoutSecondsTimeout seconds for readinessProbe5
readinessProbe.failureThresholdFailure threshold for readinessProbe6
readinessProbe.successThresholdSuccess threshold for readinessProbe1
customLivenessProbeOverride default liveness probe{}
customReadinessProbeOverride default readiness probe{}
podLabelsExtra labels for NATS pods{}
podAnnotationsAnnotations for NATS pods{}
podAffinityPresetPod affinity preset. Ignored if affinity is set. Allowed values: soft or hard""
podAntiAffinityPresetPod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hardsoft
nodeAffinityPreset.typeNode affinity preset type. Ignored if affinity is set. Allowed values: soft or hard""
nodeAffinityPreset.keyNode label key to match. Ignored if affinity is set.""
nodeAffinityPreset.valuesNode label values to match. Ignored if affinity is set.[]
affinityAffinity for pod assignment. Evaluated as a template.{}
nodeSelectorNode labels for pod assignment. Evaluated as a template.{}
tolerationsTolerations for pod assignment. Evaluated as a template.[]
extraVolumesOp

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartnats is pinned at v6.4.8 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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