Skip to content

Commit

Permalink
Add ingress for Unifi controller sevice when not using the unified se…
Browse files Browse the repository at this point in the history
…rvice. (helm#22703)

Fixes helm#21887

Bump version to 0.10.0

Signed-off-by: Stephen Liang <[email protected]>
Signed-off-by: Adrien Loiseau <[email protected]>
  • Loading branch information
stephenliang authored and li-adrienloiseau committed Jul 29, 2020
1 parent 58599d6 commit 686036e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
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.12.35
description: Ubiquiti Network's Unifi Controller
name: unifi
version: 0.9.0
version: 0.10.0
keywords:
- ubiquiti
- unifi
Expand Down
6 changes: 6 additions & 0 deletions stable/unifi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ The following tables lists the configurable parameters of the Unifi chart and th
| `controllerService.loadBalancerIP` | `{}` | Loadbalance IP for the Unifi Controller |
| `controllerService.loadBalancerSourceRanges` | None | List of IP CIDRs allowed access to load balancer (if supported) |
| `controllerService.externalTrafficPolicy` | `Cluster` | Set the externalTrafficPolicy in the Service to either Cluster or Local |
| `controllerService.ingress.enabled` | `false` | Enables 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.hosts` | `chart-example.local` | Ingress accepted hostnames for the controller |
| `controllerService.ingress.tls` | `[]` | Ingress TLS configuration for the controller |
| `stunService.type` | `NodePort` | Kubernetes service type for the Unifi STUN |
| `stunService.port` | `3478` | Kubernetes UDP port where the Unifi STUN is exposed |
| `stunService.annotations` | `{}` | Service annotations for the Unifi STUN |
Expand Down
39 changes: 39 additions & 0 deletions stable/unifi/templates/controller-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- if (and .Values.controllerService.ingress.enabled (not .Values.unifiedService.enabled)) }}
{{- $fullName := include "unifi.fullname" . -}}
{{- $ingressPath := .Values.controllerService.ingress.path -}}
{{- $unifiedServiceEnabled := .Values.unifiedService.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}-controller
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 }}
{{- with .Values.controllerService.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.controllerService.ingress.tls }}
tls:
{{- range .Values.controllerService.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.controllerService.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}-controller
servicePort: controller
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions stable/unifi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ controllerService:
# loadBalancerSourceRanges: []
## Set the externalTrafficPolicy in the Service to either Cluster or Local
# externalTrafficPolicy: Cluster
##
# Ingress settings only for the controller
ingress:
enabled: false
annotations: {}
path: /
hosts:
- chart-example.local
tls: []

stunService:
type: NodePort
Expand Down

0 comments on commit 686036e

Please sign in to comment.