unifi-poller

by portefaix

Helm chartv0.1.0App 2.1.8Apache-2.0

Unifi Poller

About this chart

unifi-poller

Unifi Poller

Homepage: https://github.com/portefaix/portefaix-hub

Maintainers

NameEmailUrl
nlamirault[email protected]https://github.com/nlamirault

Source Code

Values

KeyTypeDefaultDescription
additionalAnnotationsobject{}Additional annotations to add to all resources
additionalLabelsobject{}Additional labels to add to all resources
affinityobject{}Affinity for pod assignment Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
containerSecurityContextobject{}
extraSecretMountslist[]Additional secret mounts Defines additional mounts with secrets. Secrets must be manually created in the namespace.
imageobject{"pullPolicy":"IfNotPresent","repository":"golift/unifi-poller","tag":"2.0.0"}Docker image
ingress.annotationsobject{}
ingress.enabledboolfalse
ingress.hostslist[]
ingress.tlslist[]
livenessProbeobject{"enabled":true,"initialDelaySeconds":0,"timeoutSeconds":1}Configure Kubernetes liveness probe. Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
nodeSelectorobject{}Node labels for pod assignment Ref: https://kubernetes.io/docs/user-guide/node-selection/
podAnnotationsobject{}
priorityClassNamestring""Leverage a PriorityClass to ensure your pods survive resource shortages ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
rbac.createbooltrueSpecifies whether RBAC resources should be created
readinessProbeobject{"enabled":true,"initialDelaySeconds":0,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}Configure Kubernetes readiness probe. Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
replicasint1Number of instance
resourcesobject{}Container resources: requests and limits for CPU, Memory
restartPolicystring"Always"
secret.createbooltrueCreates the secret for Unifi Poller configuration
securityContext.fsGroupint65534
securityContext.runAsUserint65534
service.annotationsobject{}
service.portint9130
service.typestring"ClusterIP"
serviceAccount.createbooltrueSpecifies whether a ServiceAccount should be created
serviceAccount.namestringnil
serviceMonitor.additionalLabelsobject{}Add custom labels to the ServiceMonitor resource
serviceMonitor.enabledbooltrueEnable this if you're using https://github.com/coreos/prometheus-operator
serviceMonitor.honorLabelsboolfalse
serviceMonitor.intervalstring"30s"Fallback to the prometheus default unless specified
serviceMonitor.namespacestring""Namespace to deploy the ServiceMonitor
serviceMonitor.pathstring"/metrics"Path to scrape metrics
serviceMonitor.scrapeTimeoutstring"10s"Timeout for scrape metrics request
tolerationslist[]Tolerations for pod assignment Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
unifipoller.configstring`"# Unifi Poller configuration file (TOML)\n\n[poller]\n # Turns on line numbers, microsecond logging, and a per-device log.\n # The default is false, but I personally leave this on at home (four devices).\n # This may be noisy if you have a lot of devices. It adds one line per device.\n debug = false\n\n # Turns off per-interval logs. Only startup and error logs will be emitted.\n # Recommend enabling debug with this setting for better error logging.\n quiet = false\n\n # Load dynamic plugins. Advanced use; only sample mysql plugin provided by default.\n plugins = []\n\n#### OUTPUTS\n\n # If you don't use an output, you can disable it.\n\n[prometheus]\n disable = true\n # This controls on which ip and port /metrics is exported when mode is "prometheus".\n # This has no effect in other modes. Must contain a colon and port.\n http_listen = "0.0.0.0:9130"\n # Adding an SSL Cert and Cert Key will make Poller listen with SSL/https.\n ssl_cert_path = ""\n ssl_key_path = ""\n # Errors are rare. Setting this to true will report them to Prometheus.\n report_errors = false\n ## Record data for disabled or down (unlinked) switch ports.\n dead_ports = false\n\n[influxdb]\n disable = true\n # InfluxDB does not require auth by default, so the user/password are probably unimportant.\n url = "http://127.0.0.1:8086"\n user = "unifipoller"\n # Password for InfluxDB user (above).\n # If the password provided here begins with file:// then the password is read in from\n # the file path that follows the file:// prefix. ex: file:///etc/influxdb/passwd.file\n pass = "unifipoller"\n # Be sure to create this database. See the InfluxDB Wiki page for more info.\n db = "unifi"\n # If your InfluxDB uses a valid SSL cert, set this to true.\n verify_ssl = false\n # The UniFi Controller only updates traffic stats about every 30 seconds.\n # Setting this to something lower may lead to "zeros" in your data.\n # If you're getting zeros now, set this to "1m"\n interval = "30s"\n ## Record data for disabled or down (unlinked) switch ports.\n dead_ports = false\n\n# To enable output of UniFi Events to Loki, add a URL; it's disabled otherwise.\n# User, pass and tenant_id are optional and most folks wont set them.\n# Pick which logs you want per-controller in the [unifi.controller] section.\n# This is a new feature. Feedback welcome!\n[loki]\n url = ""\n # The rest of this is advanced & optional. See wiki.\n user = ""\n pass = ""\n verify_ssl = false\n tenant_id = ""\n interval = "2m"\n timeout = "10s"\n\n[datadog]\n # How often to poll UniFi and report to Datadog.\n interval = "2m"\n\n # To disable this output plugin\n disable = true\n\n # Datadog Custom Options\n\n # address to talk to the datadog agent, by default this uses the local statsd UDP interface\n # address = "localhost:8125"\n\n # namespace to prepend to all data, default is no additional prefix.\n # namespace = ""\n\n # tags to append to all data\n # tags = [ "customer:abc_corp" ]\n\n # For more advanced options for very large amount of data collected see the upstream\n # github.com/unpoller/datadogunifi repository README.\n\n\n# Unpoller has an optional web server. To turn it on, set enable to true. If you\n# wish to use SSL, provide SSL cert and key paths. This interface is currently\n# read-only; it just displays information, like logs, devices and clients.\n# Notice: Enabling the web server with many sites will increase memory usage.\n# This is a new feature and lacks a UI, enabling only recommended for testing.\n[webserver]\n enable = true\n port = 37288\n # The HTML path is different on Windows and BSD/macOS.\n html_path = "/usr/lib/unifi-poller/web"\n ssl_cert_path = ""\n ssl_key_path = ""\n # How many events per event group to hold. 200-2000. Use fewer with many sites.\n # With 1 site, you'll have a max total of 9 event groups; 1 per plugin, 4 per site.\n # Each site adds 1 event group for each of these inputs that is enabled:\n # save_ids, save_events, save_anomalies, save_alarms.\n max_events = 200\n\n# By default the web interface does not require authentication. You can change\n# that by adding a username and password hash (or multiple) below.\n# To create a hash, run unifi-poller with the -e CLI argument. See Wiki for more!\n[webserver.accounts]\n# username = "password-hash"\n# captain = "$2a$04$mxw6i0LKH6u46oaLK2cq5eCTAAFkfNiRpzNbz.EyvJZZWNa2FzIlS"\n\n#### INPUTS\n\n[unifi]\n # Setting this to true and providing default credentials allows you to skip\n # configuring controllers in this config file. Instead you configure them in\n # your prometheus.yml config. Prometheus then sends the controller URL to\n # Unpoller when it performs the scrape. This is useful if you have many,\n # or changing controllers. See wiki for more.\n dynamic = false\n\n# The following section contains the default credentials/configuration for any\n# dynamic controller (see above section), or the primary controller if you do not\n# provide one and dynamic is disabled. In other words, you can just add your\n# controller here and delete the following section. The internal defaults are\n# shown below. Any missing values will assume these displayed defaults.\n\n[unifi.defaults]\n # URL for the UniFi Controller. Do not add any paths after the host:port.\n # Do not use port 8443 if you have a UDM; just use "https://ip".\n url = "https://127.0.0.1:8443"\n\n # Make a read-only user in the UniFi Admin Settings, allow it access to all sites.\n user = "unifipoller"\n\n # Password for UniFi controller user (above).\n # If the password provided here begins with file:// then the password is read in from\n # the file path that follows the file:// prefix. ex: file:///etc/unifi/password.file\n # ex: file:///etc/unifi/passwd.file, windows: file://C:\\UserData\\Unifi\\Passwd.txt\n pass = "unifipoller"\n\n # If the controller has more than one site, specify which sites to poll here.\n # Set this to ["default"] to poll only the first site on the controller.\n # A setting of ["all"] will poll all sites; this works if you only have 1 site too.\n sites = ["all"]\n\n # Enable collection of site data. This data powers the Network Sites dashboard.\n # It's not valuable to everyone and setting this to false will save resources.\n save_sites = true\n\n # Hash, with md5, client names and MAC addresses. This attempts to protect\n # personally identifiable information. Most users won't want to enable this.\n hash_pii = false\n\n # Enable collection of Intrusion Detection System Data (InfluxDB/Loki only).\n # Only useful if IDS or IPS are enabled on one of the sites. This may store\n # a lot of information. Only recommended for testing and debugging. There\n # may not be any dashboards to display this data. It can be used for annotations.\n # Enable this only if using InfluxDB or Loki. This will leak PII data!\n save_ids = false\n\n # Enable collection of UniFi Events (InfluxDB/Loki only).\n # This may store a lot of information. Only recommended for testing and debugging.\n # There are no dashboards to display this data. It can be used for annotations.\n # This is a new (June, 2020) feature. Please provide feedback if you try it out!\n # Enable this only if using InfluxDB or Loki. This will leak PII data!\n save_events = false\n\n # Enable collection of UniFi Alarms (InfluxDB/Loki only).\n # There are no dashboards to display this data. It can be used for annotations.\n # This is a new (June, 2020) feature. Please provide feedback if you try it out!\n # Enable this only if using InfluxDB or Loki. This will leak PII data!\n save_alarms = false\n\n # Enable collection of UniFi Anomalies (InfluxDB/Loki only).\n # There are no dashboards to display this data. It can be used for annotations.\n # This is a new (June, 2020) feature. Please provide feedback if you try it out!\n # Enable this only if using InfluxDB or Loki.\n save_anomalies = false\n\n # Enable collection of Deep Packet Inspection data. This data breaks down traffic\n # types for each client and site, it powers a dedicated DPI dashboard.\n # Enabling this adds roughly 150 data points per client. That's 6000 metrics for\n # 40 clients. This adds a little bit of poller run time per interval and causes\n # more API requests to your controller(s). Don't let these "cons" sway you:\n # it's cool data. Please provide feedback on your experience with this feature.\n save_dpi = false\n\n ## Enabling save_rogue stores even more data in your time series databases.\n ## This saves neighboring access point metrics in a dedicated table or namespace.\n save_rogue = false\n\n # If your UniFi controller has a valid SSL certificate (like lets encrypt),\n # you can enable this option to validate it. Otherwise, any SSL certificate is\n # valid. If you don't know if you have a valid SSL cert, then you don't have one.\n verify_ssl = false\n\n ## You may provide a list of SSL cert files (PEM format) that you expect your\n ## controller to use. As long as one of the certs you provide here shows up in\n ## the cert trust chain the controller presents it will be accepted and allowed.\n ## These files may be re-read while poller is running.\n ## Example: ssl_cert_paths = ["/path/to/cert.pem", "/another/cert.pem"]\n ssl_cert_paths = []\n\n# The following is optional and used for configurations with multiple UniFi controllers.\n\n# You may repeat the following [[unifi.controller]] section as many times as needed to\n# poll multiple controllers. Uncomment the entire section including [[unifi.controller]].\n# Omitted variables will have their values taken from the defaults, above.\n#\n#[[unifi.controller]]\n# url = "https://127.0.0.1:8443"\n# user = "unifipoller"\n# pass = "unifipoller"\n# sites = ["all"]\n# save_sites = true\n# hash_pii = false\n# save_ids = false\n# save_events = false\n# save_alarms = false\n# save_anomalies = false\n# save_dpi = false\n#

Deploy unifi-poller with OpenTenant

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