Skip to content

Commit

Permalink
Simplify for unifi (helm#10789)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
wernerb authored and k8s-ci-robot committed Feb 8, 2019
1 parent 8655268 commit df3b21e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 167 deletions.
2 changes: 1 addition & 1 deletion stable/unifi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 5.9.29
description: Ubiquiti Network's Unifi Controller
name: unifi
version: 0.2.8
version: 0.3.0
keywords:
- ubiquiti
- unifi
Expand Down
28 changes: 8 additions & 20 deletions stable/unifi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,8 @@ The following tables lists the configurable parameters of the Unifi chart and th
| `controllerService.loadBalancerIP` | Loadbalance IP for the Unifi Controller | `{}` |
| `controllerService.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None |
| `controllerService.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` |
| `stunService.type` | Kubernetes service type for the Unifi STUN | `NodePort` |
| `stunService.port` | Kubernetes UDP port where the Unifi STUN is exposed | `3478` |
| `stunService.annotations` | Service annotations for the Unifi STUN | `{}` |
| `stunService.labels` | Custom labels | `{}` |
| `stunService.loadBalancerIP` | Loadbalance IP for the Unifi STUN | `{}` |
| `stunService.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None |
| `stunService.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` |
| `discoveryService.type` | Kubernetes service type for AP discovery | `NodePort` |
| `discoveryService.port` | Kubernetes UDP port for AP discovery | `10001` |
| `discoveryService.annotations` | Service annotations for AP discovery | `{}` |
| `discoveryService.labels` | Custom labels | `{}` |
| `discoveryService.loadBalancerIP` | Loadbalance IP for AP discovery | `{}` |
| `discoveryService.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None |
| `discoveryService.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` |
| `controllerService.stun.port` | Kubernetes UDP port where the Unifi STUN is exposed | `3478` |
| `controllerService.discovery.port` | Kubernetes UDP port for AP discovery | `10001` |
| `ingress.enabled` | Enables Ingress | `false` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.labels` | Custom labels | `{}` |
Expand Down Expand Up @@ -117,12 +105,12 @@ Read through the [values.yaml](values.yaml) file. It has several commented out s
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][ubnt 3] and [this other
article][ubnt 4] for more information.

the `controllerService` exposes two additional ports:
- `discovery`: This needs to be reachable by the unifi devices on network but only during the discovery
phase. This is a UDP service.
- `stun`: Also used periodically by the unifi devices to communicate
with the controller using UDP. See [this article][ubnt 3] and [this other article][ubnt 4] for more information.

[docker]: https://hub.docker.com/r/jacobalberty/unifi/tags/
[github]: https://github.com/jacobalberty/unifi-docker
Expand Down
14 changes: 14 additions & 0 deletions stable/unifi/templates/controller-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ spec:
name: controller
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }}
nodePort: {{.Values.controllerService.nodePort}}
{{ end }}
- port: {{ .Values.controllerService.stun.port }}
targetPort: stun
protocol: UDP
name: stun
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.stun.nodePort))) }}
nodePort: {{.Values.controllerService.stun.nodePort}}
{{ end }}
- port: {{ .Values.controllerService.discovery.port }}
targetPort: discovery
protocol: UDP
name: discovery
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.discovery.nodePort))) }}
nodePort: {{.Values.controllerService.discovery.nodePort}}
{{ end }}
selector:
app: {{ template "unifi.name" . }}
Expand Down
52 changes: 0 additions & 52 deletions stable/unifi/templates/discovery-svc.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions stable/unifi/templates/stun-svc.yaml

This file was deleted.

48 changes: 6 additions & 42 deletions stable/unifi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,48 +50,12 @@ controllerService:
# loadBalancerSourceRanges: []
## Set the externalTrafficPolicy in the Service to either Cluster or Local
# externalTrafficPolicy: Cluster

stunService:
type: NodePort
port: 3478 # udp
## 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

discoveryService:
type: NodePort
port: 10001 # udp
## 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
stun:
port: 3478
# nodePort:
discovery:
port: 10001
# nodePort:

ingress:
enabled: false
Expand Down

0 comments on commit df3b21e

Please sign in to comment.