Add ingress for Unifi controller sevice when not using the unified service. (#22703)

Fixes #21887

Bump version to 0.10.0

Signed-off-by: Stephen Liang <stephenliang@users.noreply.github.com>
This commit is contained in:
Stephen Liang 2020-06-09 20:02:04 -07:00 committed by Jeff Billimek
parent 8a7fe72ea6
commit 153620272e
No known key found for this signature in database
GPG Key ID: 214B3EF39B4956B7
4 changed files with 55 additions and 1 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 5.12.35 appVersion: 5.12.35
description: Ubiquiti Network's Unifi Controller description: Ubiquiti Network's Unifi Controller
name: unifi name: unifi
version: 0.9.0 version: 0.10.0
keywords: keywords:
- ubiquiti - ubiquiti
- unifi - unifi

View File

@ -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.loadBalancerIP` | `{}` | Loadbalance IP for the Unifi Controller |
| `controllerService.loadBalancerSourceRanges` | None | List of IP CIDRs allowed access to load balancer (if supported) | | `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.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.type` | `NodePort` | Kubernetes service type for the Unifi STUN |
| `stunService.port` | `3478` | Kubernetes UDP port where the Unifi STUN is exposed | | `stunService.port` | `3478` | Kubernetes UDP port where the Unifi STUN is exposed |
| `stunService.annotations` | `{}` | Service annotations for the Unifi STUN | | `stunService.annotations` | `{}` | Service annotations for the Unifi STUN |

View File

@ -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 }}

View File

@ -117,6 +117,15 @@ controllerService:
# loadBalancerSourceRanges: [] # loadBalancerSourceRanges: []
## 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
##
# Ingress settings only for the controller
ingress:
enabled: false
annotations: {}
path: /
hosts:
- chart-example.local
tls: []
stunService: stunService:
type: NodePort type: NodePort