[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
description: Ubiquiti Network's Unifi Controller
name: unifi
version: 1.5.6
version: 2.0.0
keywords:
- ubiquiti
- unifi

View File

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

View File

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

View File

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

View File

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