[unifi] Rename port names for better traefik integration (#766)

* Rename port names for better traefik integration

Traefik automatically talks to backends via https when the port name starts with https. [1]
Otherwise you have to add the annotation traefik.ingress.kubernetes.io/service.serversscheme: https to the service.

[1] https://doc.traefik.io/traefik/routing/providers/kubernetes-ingress/#communication-between-traefik-and-pods

* Bump Version to 2.0.0

As this changes the port name it might be considered a breaking change. Therefore  @onedr0p suggested a major version bump.

Co-authored-by: Clemens Bergmann <clemens.bergmann@tu-darmstadt.de>
Co-authored-by: ᗪєνιη ᗷυнʟ <onedr0p@users.noreply.github.com>
This commit is contained in:
Clemens Bergmann 2021-04-07 23:09:14 +02:00 committed by GitHub
parent 516468ef58
commit 2a687c360a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 15 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: 6.0.45 appVersion: 6.0.45
description: Ubiquiti Network's Unifi Controller description: Ubiquiti Network's Unifi Controller
name: unifi name: unifi
version: 1.5.6 version: 2.0.0
keywords: keywords:
- ubiquiti - ubiquiti
- unifi - unifi

View File

@ -48,16 +48,16 @@ spec:
name: {{ $fullName }}-captiveportalservice name: {{ $fullName }}-captiveportalservice
port: port:
{{- if $captivePortalHttps }} {{- if $captivePortalHttps }}
name: captive-https name: https-captive
{{- else }} {{- else }}
name: captive-http name: http-captive
{{- end }} {{- end }}
{{- else }} {{- else }}
serviceName: {{ $fullName }}-captiveportalservice serviceName: {{ $fullName }}-captiveportalservice
{{- if $captivePortalHttps }} {{- if $captivePortalHttps }}
servicePort: captive-https servicePort: https-captive
{{- else }} {{- else }}
servicePort: captive-http servicePort: http-captive
{{- end }} {{- end }}
{{- end -}} {{- end -}}
{{- end }} {{- end }}

View File

@ -42,16 +42,16 @@ spec:
{{- end }} {{- end }}
ports: ports:
- port: {{ .Values.captivePortalService.http }} - port: {{ .Values.captivePortalService.http }}
targetPort: captive-http targetPort: http-captive
protocol: TCP protocol: TCP
name: captive-http name: http-captive
{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.http))) }} {{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.http))) }}
nodePort: {{.Values.captivePortalService.http}} nodePort: {{.Values.captivePortalService.http}}
{{ end }} {{ end }}
- port: {{ .Values.captivePortalService.https }} - port: {{ .Values.captivePortalService.https }}
targetPort: captive-https targetPort: https-captive
protocol: TCP protocol: TCP
name: captive-https name: https-captive
{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.https))) }} {{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.https))) }}
nodePort: {{.Values.captivePortalService.https}} nodePort: {{.Values.captivePortalService.https}}
{{ end }} {{ end }}

View File

@ -68,10 +68,10 @@ spec:
containerPort: 5514 containerPort: 5514
protocol: UDP protocol: UDP
{{- if .Values.captivePortalService.enabled }} {{- if .Values.captivePortalService.enabled }}
- name: captive-http - name: http-captive
containerPort: {{ .Values.captivePortalService.http }} containerPort: {{ .Values.captivePortalService.http }}
protocol: TCP protocol: TCP
- name: captive-https - name: https-captive
containerPort: {{ .Values.captivePortalService.https }} containerPort: {{ .Values.captivePortalService.https }}
protocol: TCP protocol: TCP
{{- end }} {{- end }}

View File

@ -77,17 +77,17 @@ spec:
nodePort: {{.Values.guiService.nodePort}} nodePort: {{.Values.guiService.nodePort}}
{{ end }} {{ end }}
{{ if .Values.captivePortalService.enabled }} {{ if .Values.captivePortalService.enabled }}
- name: captive-http - name: http-captive
port: {{ .Values.captivePortalService.http }} port: {{ .Values.captivePortalService.http }}
protocol: TCP protocol: TCP
targetPort: captive-http targetPort: http-captive
{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.http))) }} {{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.http))) }}
nodePort: {{.Values.captivePortalService.http}} nodePort: {{.Values.captivePortalService.http}}
{{ end }} {{ end }}
- name: captive-https - name: https-captive
port: {{ .Values.captivePortalService.https }} port: {{ .Values.captivePortalService.https }}
protocol: TCP protocol: TCP
targetPort: captive-https targetPort: https-captive
{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.https))) }} {{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.https))) }}
nodePort: {{.Values.captivePortalService.https}} nodePort: {{.Values.captivePortalService.https}}
{{ end }} {{ end }}