unifi

by joaquinito2051

Helm chartv0.4.2App 5.10.19

Ubiquiti Network's Unifi Controller

About this chart

Ubiquiti Network's Unifi Controller

This is a helm chart for [Ubiquiti Network's][ubnt] [Unifi Controller][ubnt 2].

TL;DR;

helm install <helm-repo>/unifi

helm install stable/unifi

Introduction

This code is adopted from [this original repo][github].

Installing the Chart

To install the chart with the release name my-release:

helm install --name my-release <helm-repo>/unifi

helm install --name my-release stable/unifi

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release --purge

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following tables lists the configurable parameters of the Unifi chart and their default values.

ParameterDescriptionDefault
image.repositoryImage repositoryjacobalberty/unifi
image.tagImage tag. Possible values listed [here][docker].5.9.29
image.pullPolicyImage pull policyIfNotPresent
strategyTypeSpecifies the strategy used to replace old Pods by new onesRecreate
guiService.typeKubernetes service type for the Unifi GUIClusterIP
guiService.portKubernetes port where the Unifi GUI is exposed8443
guiService.annotationsService annotations for the Unifi GUI{}
guiService.labelsCustom labels{}
guiService.loadBalancerIPLoadbalance IP for the Unifi GUI{}
guiService.loadBalancerSourceRangesList of IP CIDRs allowed access to load balancer (if supported)None
guiService.externalTrafficPolicySet the externalTrafficPolicy in the Service to either Cluster or LocalCluster
controllerService.typeKubernetes service type for the Unifi Controller communicationNodePort
controllerService.portKubernetes port where the Unifi Controller is exposed - this needs to be reachable by the unifi devices on the network8080
controllerService.annotationsService annotations for the Unifi Controller{}
controllerService.labelsCustom labels{}
controllerService.loadBalancerIPLoadbalance IP for the Unifi Controller{}
controllerService.loadBalancerSourceRangesList of IP CIDRs allowed access to load balancer (if supported)None
controllerService.externalTrafficPolicySet the externalTrafficPolicy in the Service to either Cluster or LocalCluster
stunService.typeKubernetes service type for the Unifi STUNNodePort
stunService.portKubernetes UDP port where the Unifi STUN is exposed3478
stunService.annotationsService annotations for the Unifi STUN{}
stunService.labelsCustom labels{}
stunService.loadBalancerIPLoadbalance IP for the Unifi STUN{}
stunService.loadBalancerSourceRangesList of IP CIDRs allowed access to load balancer (if supported)None
stunService.externalTrafficPolicySet the externalTrafficPolicy in the Service to either Cluster or LocalCluster
discoveryService.typeKubernetes service type for AP discoveryNodePort
discoveryService.portKubernetes UDP port for AP discovery10001
discoveryService.annotationsService annotations for AP discovery{}
discoveryService.labelsCustom labels{}
discoveryService.loadBalancerIPLoadbalance IP for AP discovery{}
discoveryService.loadBalancerSourceRangesList of IP CIDRs allowed access to load balancer (if supported)None
discoveryService.externalTrafficPolicySet the externalTrafficPolicy in the Service to either Cluster or LocalCluster
unifiedService.enabledUse a single service for GUI, controller, STUN, and discoveryfalse
unifiedService.typeKubernetes service type for the unified serviceClusterIP
unifiedService.annotationsAnnotations for the unified service{}
unifiedService.labelsCustom labels for the unified service{}
unifiedService.loadBalancerIPLoad balancer IP for the unified serviceNone
unifiedService.loadBalancerSourceRangesList of IP CIDRs allowed access to the load balancer (if supported)None
unifiedService.externalTrafficPolicySet the externalTrafficPolicy in the service to either Cluster or LocalCluster
ingress.enabledEnables Ingressfalse
ingress.annotationsIngress annotations{}
ingress.labelsCustom labels{}
ingress.pathIngress path/
ingress.hostsIngress accepted hostnameschart-example.local
ingress.tlsIngress TLS configuration[]
timezoneTimezone the Unifi controller should run as, e.g. 'America/New York'UTC
runAsRootRun the controller as UID0 (root user); if set to false, will give container SETFCAP insteadfalse
UIDRun the controller as user UID999
GIDRun the controller as group GID999
mongodb.enabledUse external MongoDB for data storagefalse
mongodb.dbUriexternal MongoDB URImongodb://mongo/unifi
mongodb.statDbUriexternal MongoDB statdb URImongodb://mongo/unifi_stat
mongodb.databaseNameexternal MongoDB database nameunifi
persistence.enabledUse persistent volume to store datatrue
persistence.sizeSize of persistent volume claim5Gi
persistence.existingClaimUse an existing PVC to persist datanil
persistence.storageClassType of persistent volume claim-
persistence.accessModesPersistence access modes[]
resourcesCPU/Memory resource requests/limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
affinityAffinity settings for pod assignment{}
podAnnotationsKey-value pairs to add as pod annotations{}

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Spe

Deploy unifi with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has unifi 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 chartunifi is pinned at v0.4.2 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