Back to Charts

DEPRECATED - Network's Unifi Controller

stable/unifi/README.md

latest22.6 KB
Original Source

DEPRECATED - Network's Unifi Controller

|This chart has been deprecated and moved to its new home: | |- GitHub repo: https://github.com/k8s-at-home/charts/tree/master/charts/unifi |- Charts repo: https://k8s-at-home.com/charts/

This is a helm chart for Ubiquiti Network's Unifi Controller.

TL;DR;

console
helm install stable/unifi

Introduction

This code is adopted from this original repo.

Installing the Chart

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

console
helm install --name my-release stable/unifi

Uninstalling the Chart

To uninstall/delete the my-release deployment:

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

ParameterDefaultDescription
image.repositoryjacobalberty/unifiImage repository
image.tag5.12.35Image tag. Possible values listed here.
image.pullPolicyIfNotPresentImage pull policy
strategyTypeRecreateSpecifies the strategy used to replace old Pods by new ones
guiService.typeClusterIPKubernetes service type for the Unifi GUI
guiService.port8443Kubernetes port where the Unifi GUI is exposed
guiService.annotations{}Service annotations for the Unifi GUI
guiService.labels{}Custom labels
guiService.loadBalancerIP{}Loadbalance IP for the Unifi GUI
guiService.loadBalancerSourceRangesNoneList of IP CIDRs allowed access to load balancer (if supported)
guiService.externalTrafficPolicyClusterSet the externalTrafficPolicy in the Service to either Cluster or Local
captivePortalService.enabledfalseInstall the captive portal service (needed if you want guest captive portal)
captivePortalService.typeClusterIPKubernetes service type for the captive portal
captivePortalService.http8880Kubernetes port where the captive portal is exposed
captivePortalService.https8843Kubernetes port where the captive portal is exposed (with SSL)
captivePortalService.annotations{}Service annotations for the captive portal
captivePortalService.labels{}Custom labels
captivePortalService.loadBalancerIP{}Loadbalance IP for the Unifi GUI
captivePortalService.loadBalancerSourceRangesNoneList of IP CIDRs allowed access to load balancer (if supported)
captivePortalService.externalTrafficPolicyClusterSet the externalTrafficPolicy in the Service to either Cluster or Local
captivePortalService.ingress.enabledfalseEnables Ingress (for the captive portal, the main ingress needs to be enabled for the controller to be accessible)
captivePortalService.ingress.annotations{}Ingress annotations for the captive portal
captivePortalService.ingress.labels{}Custom labels for the captive portal
captivePortalService.ingress.path/Ingress path for the captive portal
captivePortalService.ingress.hostschart-example.localIngress accepted hostnames for the captive portal
captivePortalService.ingress.tls[]Ingress TLS configuration for the captive portal
controllerService.typeNodePortKubernetes service type for the Unifi Controller communication
controllerService.port8080Kubernetes port where the Unifi Controller is exposed - this needs to be reachable by the unifi devices on the network
controllerService.annotations{}Service annotations for the Unifi Controller
controllerService.labels{}Custom labels
controllerService.loadBalancerIP{}Loadbalance IP for the Unifi Controller
controllerService.loadBalancerSourceRangesNoneList of IP CIDRs allowed access to load balancer (if supported)
controllerService.externalTrafficPolicyClusterSet the externalTrafficPolicy in the Service to either Cluster or Local
controllerService.ingress.enabledfalseEnables Ingress for the controller
controllerService.ingress.annotations{}Ingress annotations for the controller
controllerService.ingress.labels{}Custom labels for the controller
controllerService.ingress.path/Ingress path for the controller
controllerService.ingress.hostschart-example.localIngress accepted hostnames for the controller
controllerService.ingress.tls[]Ingress TLS configuration for the controller
stunService.typeNodePortKubernetes service type for the Unifi STUN
stunService.port3478Kubernetes UDP port where the Unifi STUN is exposed
stunService.annotations{}Service annotations for the Unifi STUN
stunService.labels{}Custom labels
stunService.loadBalancerIP{}Loadbalance IP for the Unifi STUN
stunService.loadBalancerSourceRangesNoneList of IP CIDRs allowed access to load balancer (if supported)
stunService.externalTrafficPolicyClusterSet the externalTrafficPolicy in the Service to either Cluster or Local
discoveryService.typeNodePortKubernetes service type for AP discovery
discoveryService.port10001Kubernetes UDP port for AP discovery
discoveryService.annotations{}Service annotations for AP discovery
discoveryService.labels{}Custom labels
discoveryService.loadBalancerIP{}Loadbalance IP for AP discovery
discoveryService.loadBalancerSourceRangesNoneList of IP CIDRs allowed access to load balancer (if supported)
discoveryService.externalTrafficPolicyClusterSet the externalTrafficPolicy in the Service to either Cluster or Local
unifiedService.enabledfalseUse a single service for GUI, controller, STUN, and discovery
unifiedService.typeClusterIPKubernetes service type for the unified service
unifiedService.annotations{}Annotations for the unified service
unifiedService.labels{}Custom labels for the unified service
unifiedService.loadBalancerIPNoneLoad balancer IP for the unified service
unifiedService.loadBalancerSourceRangesNoneList of IP CIDRs allowed access to the load balancer (if supported)
unifiedService.externalTrafficPolicyClusterSet the externalTrafficPolicy in the service to either Cluster or Local
ingress.enabledfalseEnables Ingress
ingress.annotations{}Ingress annotations
ingress.labels{}Custom labels
ingress.path/Ingress path
ingress.hostschart-example.localIngress accepted hostnames
ingress.tls[]Ingress TLS configuration
timezoneUTCTimezone the Unifi controller should run as, e.g. 'America/New York'
runAsRootfalseRun the controller as UID0 (root user); if set to false, will give container SETFCAP instead
UID999Run the controller as user UID
GID999Run the controller as group GID
customCert.enabledfalseDefine whether you are using s custom certificate
customCert.isChainfalseIf you are using a Let's Encrypt certificate which already includes the full chain set this to true
customCert.certNametls.crtName of the the certificate file in <unifi-data>/cert
customCert.keyNametls.keyName of the the private key file in <unifi-data>/cert
customCert.certSecretnilName of the the k8s tls secret where the certificate and its key are stored.
mongodb.enabledfalseUse external MongoDB for data storage
mongodb.dbUrimongodb://mongo/unifiexternal MongoDB URI
mongodb.statDbUrimongodb://mongo/unifi_statexternal MongoDB statdb URI
mongodb.databaseNameunifiexternal MongoDB database name
persistence.enabledtrueUse persistent volume to store data
persistence.size5GiSize of persistent volume claim
persistence.existingClaimnilUse an existing PVC to persist data
persistence.subPath``Store data in a subdirectory of PV instead of at the root directory
persistence.storageClass-Type of persistent volume claim
extraVolumes[]Additional volumes to be used by extraVolumeMounts
extraVolumeMounts[]Additional volume mounts to be mounted in unifi container
persistence.accessModes[]Persistence access modes
extraConfigFiles{}Dictionary containing files mounted to /configmap inside the pod (See values.yaml for examples)
extraJvmOpts[]List of additional JVM options, e.g. ["-Dlog4j.configurationFile=file:/configmap/log4j2.xml"]
resources{}CPU/Memory resource requests/limits
nodeSelector{}Node labels for pod assignment
tolerations[]Toleration labels for pod assignment
affinity{}Affinity settings for pod assignment
podAnnotations{}Key-value pairs to add as pod annotations
deploymentAnnotations{}Key-value pairs to add as deployment annotations

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

console
helm install --name my-release \
  --set timezone="America/New York" \
    stable/unifi

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

console
helm install --name my-release -f values.yaml stable/unifi

Read through the values.yaml file. It has several commented out suggested values.

Regarding the services

  • guiService: Represents the main web UI and is what one would normally point the ingress to.
  • captivePortalService: This service is used to allow the captive portal webpage to be accessible. It needs to be reachable by the clients connecting to your guest network.
  • controllerService: This is needed in order for the unifi devices to talk to the controller and must be otherwise exposed to the network where the unifi devices run. If you run this as a NodePort (the default setting), make sure that there is an external load balancer that is directing traffic from port 8080 to the NodePort for this service.
  • discoveryService: This needs to be reachable by the unifi devices on the network similar to the controller Service but only during the discovery phase. This is a UDP service.
  • stunService: Also used periodically by the unifi devices to communicate with the controller using UDP. See this article and this other article for more information.

Ingress and HTTPS

Unifi does not support HTTP so if you wish to use the guiService, you need to ensure that you use a backend transport of HTTPS.

An example entry in values.yaml to achieve this is as follows:

ingress:
  enabled: true
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"