nats

by KubeGems

Helm chartv6.3.10App 2.3.1

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

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)

Common parameters

ParameterDescriptionDefault
nameOverrideString to partially override common.names.fullnamenil
fullnameOverrideString to fully override common.names.fullnamenil
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
clusterDomainDefault Kubernetes cluster domaincluster.local
extraDeployArray of extra objects to deploy with the release[] (evaluated as a template)
kubeVersionForce target Kubernetes version (using Helm capabilities if not set)nil

NATS parameters

ParameterDescriptionDefault
image.registryNATS image registrydocker.io
image.repositoryNATS image namebitnami/nats
image.tagNATS image tag{TAG_NAME}
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
hostAliasesAdd deployment host aliases[]
auth.enabledSwitch to enable/disable client authenticationtrue
auth.userClient authentication usernats_client
auth.passwordClient authentication passwordrandom alhpanumeric string (10)
auth.tokenClient authentication tokennil
auth.timeoutClient authentication timeout (seconds)1
clusterAuth.enabledSwitch to enable/disable cluster authenticationtrue
clusterAuth.userCluster authentication usernats_cluster
clusterAuth.passwordCluster authentication passwordrandom alhpanumeric string (10)
clusterAuth.tokenCluster authentication tokennil
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 connectionsnil
maxControlLineMax. protocol control linenil
maxPayloadMax. payloadnil
writeDeadlineDuration the server can block on a socket write to a clientnil
natsFilenameFilename used by several NATS files (binary, configurarion file, and pid file)nats-server
commandOverride default container command (useful when using custom images)nil
argsOverride default container args (useful when using custom images)nil
metrics.kafka.extraFlagsExtra flags to be passed to NATS{}
extraEnvVarsExtra environment variables to be set on NATS container{}
extraEnvVarsCMName of existing ConfigMap containing extra env varsnil
extraEnvVarsSecretName of existing Secret containing extra env varsnil

NATS deployment/statefulset parameters

ParameterDescriptionDefault
resourceTypeNATS cluster resource type under Kubernetes (Supported: StatefulSets, or Deployment)statefulset
replicaCountNumber of NATS nodes1
schedulerNameName of an alternatenil
priorityClassNameName of pod priority classnil
podSecurityContextNATS pods' Security ContextCheck values.yaml file
updateStrategyStrategy to use to update PodsCheck values.yaml file
containerSecurityContextNATS containers' Security ContextCheck values.yaml file
resources.limitsThe resources limits for the NATS container{}
resources.requestsThe requested resources for the NATS container{}
livenessProbeLiveness probe configuration for NATSCheck values.yaml file
readinessProbeReadiness probe configuration for NATSCheck values.yaml file
customLivenessProbeOverride default liveness probenil
customReadinessProbeOverride default readiness probenil
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)
podLabelsExtra labels for NATS pods{} (evaluated as a template)
podAnnotationsAnnotations for NATS pods{} (evaluated as a template)
extraVolumeMountsOptionally specify extra list of additional volumeMounts for NATS container(s)[]
extraVolumesOptionally specify extra list of additional volumes for NATS pods[]
initContainersAdd additional init containers to the NATS pods{} (evaluated as a template)
sidecarsAdd additional sidecar containers to the NATS pods{} (evaluated as a template)

Exposure parameters

ParameterDescriptionDefault
client.service.typeKubernetes Service type (NATS client)ClusterIP
client.service.portNATS client port4222
client.service.nodePortPort to bind to for NodePort service type (NATS client)nil
client.service.annotationsAnnotations 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.

  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.3.10 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