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

[stable/unifi] Add ingress for Unifi controller sevice #22703

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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