Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Commit 548eaba

Browse files
committed
Simplify for unifi
The discovery and stun ports are part of the same service. Unifi depends on them to be on the same hostname. Signed-off-by: Werner Buck <email@wernerbuck.nl>
1 parent d26f5d4 commit 548eaba

File tree

6 files changed

+30
-167
lines changed

6 files changed

+30
-167
lines changed

stable/unifi/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
appVersion: 5.9.29
33
description: Ubiquiti Network's Unifi Controller
44
name: unifi
5-
version: 0.2.8
5+
version: 0.2.9
66
keywords:
77
- ubiquiti
88
- unifi

stable/unifi/README.md

+8-20
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,8 @@ The following tables lists the configurable parameters of the Unifi chart and th
5353
| `controllerService.loadBalancerIP` | Loadbalance IP for the Unifi Controller | `{}` |
5454
| `controllerService.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None |
5555
| `controllerService.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` |
56-
| `stunService.type` | Kubernetes service type for the Unifi STUN | `NodePort` |
57-
| `stunService.port` | Kubernetes UDP port where the Unifi STUN is exposed | `3478` |
58-
| `stunService.annotations` | Service annotations for the Unifi STUN | `{}` |
59-
| `stunService.labels` | Custom labels | `{}` |
60-
| `stunService.loadBalancerIP` | Loadbalance IP for the Unifi STUN | `{}` |
61-
| `stunService.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None |
62-
| `stunService.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` |
63-
| `discoveryService.type` | Kubernetes service type for AP discovery | `NodePort` |
64-
| `discoveryService.port` | Kubernetes UDP port for AP discovery | `10001` |
65-
| `discoveryService.annotations` | Service annotations for AP discovery | `{}` |
66-
| `discoveryService.labels` | Custom labels | `{}` |
67-
| `discoveryService.loadBalancerIP` | Loadbalance IP for AP discovery | `{}` |
68-
| `discoveryService.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None |
69-
| `discoveryService.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` |
56+
| `controllerService.stun.port` | Kubernetes UDP port where the Unifi STUN is exposed | `3478` |
57+
| `controllerService.discovery.port` | Kubernetes UDP port for AP discovery | `10001` |
7058
| `ingress.enabled` | Enables Ingress | `false` |
7159
| `ingress.annotations` | Ingress annotations | `{}` |
7260
| `ingress.labels` | Custom labels | `{}` |
@@ -117,12 +105,12 @@ Read through the [values.yaml](values.yaml) file. It has several commented out s
117105
devices run. If you run this as a `NodePort` (the default setting), make sure
118106
that there is an external load balancer that is directing traffic from port
119107
8080 to the `NodePort` for this service.
120-
- `discoveryService`: This needs to be reachable by the unifi devices on the
121-
network similar to the controller `Service` but only during the discovery
122-
phase. This is a UDP service.
123-
- `stunService`: Also used periodically by the unifi devices to communicate
124-
with the controller using UDP. See [this article][ubnt 3] and [this other
125-
article][ubnt 4] for more information.
108+
109+
the `controllerService` exposes two additional ports:
110+
- `discovery`: This needs to be reachable by the unifi devices on network but only during the discovery
111+
phase. This is a UDP service.
112+
- `stun`: Also used periodically by the unifi devices to communicate
113+
with the controller using UDP. See [this article][ubnt 3] and [this other article][ubnt 4] for more information.
126114

127115
[docker]: https://hub.docker.com/r/jacobalberty/unifi/tags/
128116
[github]: https://github.com/jacobalberty/unifi-docker

stable/unifi/templates/controller-svc.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ spec:
4646
name: controller
4747
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }}
4848
nodePort: {{.Values.controllerService.nodePort}}
49+
{{ end }}
50+
- port: {{ .Values.controllerService.stun.port }}
51+
targetPort: stun
52+
protocol: UDP
53+
name: stun
54+
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.stun.nodePort))) }}
55+
nodePort: {{.Values.controllerService.stun.nodePort}}
56+
{{ end }}
57+
- port: {{ .Values.controllerService.discovery.port }}
58+
targetPort: discovery
59+
protocol: UDP
60+
name: discovery
61+
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.discovery.nodePort))) }}
62+
nodePort: {{.Values.controllerService.discovery.nodePort}}
4963
{{ end }}
5064
selector:
5165
app: {{ template "unifi.name" . }}

stable/unifi/templates/discovery-svc.yaml

-52
This file was deleted.

stable/unifi/templates/stun-svc.yaml

-52
This file was deleted.

stable/unifi/values.yaml

+7-42
Original file line numberDiff line numberDiff line change
@@ -50,48 +50,13 @@ controllerService:
5050
# loadBalancerSourceRanges: []
5151
## Set the externalTrafficPolicy in the Service to either Cluster or Local
5252
# externalTrafficPolicy: Cluster
53-
54-
stunService:
55-
type: NodePort
56-
port: 3478 # udp
57-
## Specify the nodePort value for the LoadBalancer and NodePort service types.
58-
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
59-
##
60-
# nodePort:
61-
## Provide any additional annotations which may be required. This can be used to
62-
## set the LoadBalancer service type to internal only.
63-
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
64-
##
65-
annotations: {}
66-
labels: {}
67-
## Use loadBalancerIP to request a specific static IP,
68-
## otherwise leave blank
69-
##
70-
loadBalancerIP:
71-
# loadBalancerSourceRanges: []
72-
## Set the externalTrafficPolicy in the Service to either Cluster or Local
73-
# externalTrafficPolicy: Cluster
74-
75-
discoveryService:
76-
type: NodePort
77-
port: 10001 # udp
78-
## Specify the nodePort value for the LoadBalancer and NodePort service types.
79-
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
80-
##
81-
# nodePort:
82-
## Provide any additional annotations which may be required. This can be used to
83-
## set the LoadBalancer service type to internal only.
84-
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
85-
##
86-
annotations: {}
87-
labels: {}
88-
## Use loadBalancerIP to request a specific static IP,
89-
## otherwise leave blank
90-
##
91-
loadBalancerIP:
92-
# loadBalancerSourceRanges: []
93-
## Set the externalTrafficPolicy in the Service to either Cluster or Local
94-
# externalTrafficPolicy: Cluster
53+
54+
stun:
55+
port: 3478
56+
# nodePort:
57+
discovery:
58+
port: 10001 # udp
59+
# nodePort:
9560

9661
ingress:
9762
enabled: false

0 commit comments

Comments
 (0)