[unifi] add speedtest service and update to 5.14.23 (#148)

* add speedtest service and update to 5.14.23

* forgot speedtest in unified service

Co-authored-by: Jeff Billimek <jeff@billimek.com>
This commit is contained in:
Simon Smith 2020-11-14 19:55:11 +00:00 committed by GitHub
parent 846337f619
commit b91e6c69d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 99 additions and 5 deletions

View File

@ -1,8 +1,8 @@
apiVersion: v2 apiVersion: v2
appVersion: 5.12.35 appVersion: 5.14.23
description: Ubiquiti Network's Unifi Controller description: Ubiquiti Network's Unifi Controller
name: unifi name: unifi
version: 1.1.0 version: 1.1.1
keywords: keywords:
- ubiquiti - ubiquiti
- unifi - unifi

View File

@ -34,7 +34,7 @@ The following tables lists the configurable parameters of the Unifi chart and th
| Parameter | Default | Description | | Parameter | Default | Description |
|-------------------------------------------------|------------------------------|------------------------------------------------------------------------------------------------------------------------| |-------------------------------------------------|------------------------------|------------------------------------------------------------------------------------------------------------------------|
| `image.repository` | `jacobalberty/unifi` | Image repository | | `image.repository` | `jacobalberty/unifi` | Image repository |
| `image.tag` | `5.12.35` | Image tag. Possible values listed [here][docker]. | | `image.tag` | `5.14.23` | Image tag. Possible values listed [here][docker]. |
| `image.pullPolicy` | `IfNotPresent` | Image pull policy | | `image.pullPolicy` | `IfNotPresent` | Image pull policy |
| `strategyType` | `Recreate` | Specifies the strategy used to replace old Pods by new ones | | `strategyType` | `Recreate` | Specifies the strategy used to replace old Pods by new ones |
| `guiService.type` | `ClusterIP` | Kubernetes service type for the Unifi GUI | | `guiService.type` | `ClusterIP` | Kubernetes service type for the Unifi GUI |
@ -93,7 +93,14 @@ The following tables lists the configurable parameters of the Unifi chart and th
| `syslogService.loadBalancerIP` | `{}` | Loadbalancer IP for remote syslog capture | | `syslogService.loadBalancerIP` | `{}` | Loadbalancer IP for remote syslog capture |
| `syslogService.loadBalancerSourceRanges` | None | List of IP CIDRs allowed access to load balancer (if supported) | | `syslogService.loadBalancerSourceRanges` | None | List of IP CIDRs allowed access to load balancer (if supported) |
| `syslogService.externalTrafficPolicy` | `Cluster` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | `syslogService.externalTrafficPolicy` | `Cluster` | Set the externalTrafficPolicy in the Service to either Cluster or Local |
| `unifiedService.enabled` | `false` | Use a single service for GUI, controller, STUN, discovery and syslog | | `speedtestService.type` | `ClusterIP` | Kubernetes service type for mobile speedtest |
| `speedtestService.port` | `6789` | Kubernetes UDP port for mobile speedtest |
| `speedtestService.annotations` | `{}` | Service annotations for mobile speedtest |
| `speedtestService.labels` | `{}` | Custom labels |
| `speedtestService.loadBalancerIP` | `{}` | Loadbalancer IP for mobile speedtest |
| `speedtestService.loadBalancerSourceRanges` | None | List of IP CIDRs allowed access to load balancer (if supported) |
| `speedtestService.externalTrafficPolicy` | `Cluster` | Set the externalTrafficPolicy in the Service to either Cluster or Local |
| `unifiedService.enabled` | `false` | Use a single service for GUI, controller, STUN, discovery, syslog and speedtest |
| `unifiedService.type` | `ClusterIP` | Kubernetes service type for the unified service | | `unifiedService.type` | `ClusterIP` | Kubernetes service type for the unified service |
| `unifiedService.annotations` | `{}` | Annotations for the unified service | | `unifiedService.annotations` | `{}` | Annotations for the unified service |
| `unifiedService.labels` | `{}` | Custom labels for the unified service | | `unifiedService.labels` | `{}` | Custom labels for the unified service |
@ -178,6 +185,8 @@ Read through the [values.yaml](values.yaml) file. It has several commented out s
- `syslogService`: Used to capture syslog from Unifi devices if the feature is - `syslogService`: Used to capture syslog from Unifi devices if the feature is
enabled in the site configuration. This needs to be reachable by Unifi devices enabled in the site configuration. This needs to be reachable by Unifi devices
on port 5514/UDP. on port 5514/UDP.
- `speedtestService`: Used for mobile speedtest inside the UniFi Mobile app.
This needs to be reachable by clients connecting to port 6789/TCP.
## Ingress and HTTPS ## Ingress and HTTPS

View File

@ -75,6 +75,9 @@ spec:
- name: captive-https - name: captive-https
containerPort: 8843 containerPort: 8843
protocol: TCP protocol: TCP
- name: speedtest
containerPort: 6789
protocol: TCP
{{ end }} {{ end }}
{{- if not .Values.runAsRoot }} {{- if not .Values.runAsRoot }}
securityContext: securityContext:

View File

@ -0,0 +1,54 @@
{{ if not .Values.speedtestService.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "unifi.fullname" . }}-speedtest
labels:
app.kubernetes.io/name: {{ include "unifi.name" . }}
helm.sh/chart: {{ include "unifi.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.speedtestService.labels }}
{{ toYaml .Values.speedtestService.labels | indent 4 }}
{{- end }}
{{- with .Values.speedtestService.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.speedtestService.type "ClusterIP") (empty .Values.speedtestService.type)) }}
type: ClusterIP
{{- if .Values.speedtestService.clusterIP }}
clusterIP: {{ .Values.speedtestService.clusterIP }}
{{end}}
{{- else if eq .Values.speedtestService.type "LoadBalancer" }}
type: {{ .Values.speedtestService.type }}
{{- if .Values.speedtestService.loadBalancerIP }}
loadBalancerIP: {{ .Values.speedtestService.loadBalancerIP }}
{{- end }}
{{- if .Values.speedtestService.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.speedtestService.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.speedtestService.type }}
{{- end }}
{{- if .Values.speedtestService.externalIPs }}
externalIPs:
{{ toYaml .Values.speedtestService.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.speedtestService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.speedtestService.externalTrafficPolicy }}
{{- end }}
ports:
- port: {{ .Values.speedtestService.port }}
targetPort: speedtest
protocol: TCP
name: speedtest
{{ if (and (eq .Values.speedtestService.type "NodePort") (not (empty .Values.speedtestService.nodePort))) }}
nodePort: {{.Values.speedtestService.nodePort}}
{{ end }}
selector:
app.kubernetes.io/name: {{ include "unifi.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ end }}

View File

@ -90,6 +90,13 @@ spec:
targetPort: captive-https targetPort: captive-https
{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.https))) }} {{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.https))) }}
nodePort: {{.Values.captivePortalService.https}} nodePort: {{.Values.captivePortalService.https}}
{{ end }}
- port: {{ .Values.speedtestService.port }}
targetPort: speedtest
protocol: TCP
name: speedtest
{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.speedtestService.nodePort))) }}
nodePort: {{.Values.speedtestService.nodePort}}
{{ end }} {{ end }}
{{ end }} {{ end }}

View File

@ -7,7 +7,7 @@ strategyType: Recreate
image: image:
repository: jacobalberty/unifi repository: jacobalberty/unifi
tag: 5.12.35 tag: 5.14.23
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# If enabled, the controller, discovery, GUI, STUN and syslog services will not be # If enabled, the controller, discovery, GUI, STUN and syslog services will not be
@ -190,6 +190,27 @@ syslogService:
## Set the externalTrafficPolicy in the Service to either Cluster or Local ## Set the externalTrafficPolicy in the Service to either Cluster or Local
# externalTrafficPolicy: Cluster # externalTrafficPolicy: Cluster
speedtestService:
type: ClusterIP
port: 6789
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort:
## Provide any additional annotations which may be required. This can be used to
## set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
annotations: {}
labels: {}
## Use loadBalancerIP to request a specific static IP,
## otherwise leave blank
##
loadBalancerIP:
# loadBalancerSourceRanges: []
## Set the externalTrafficPolicy in the Service to either Cluster or Local
# externalTrafficPolicy: Cluster
ingress: ingress:
enabled: false enabled: false
annotations: {} annotations: {}