forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable/unifi] Adding captive portal service (helm#21241)
* [stable/unifi] Adding captive portal service Signed-off-by: Arno Dubois <arno.du@orange.fr> Signed-off-by: Arno DUBOIS <arnodubois@sweetpunk.com> * [stable/unifi] Annnd bumping version Signed-off-by: Arno Dubois <arno.du@orange.fr> Signed-off-by: Arno DUBOIS <arnodubois@sweetpunk.com> * Added an enabled switch Signed-off-by: Arno DUBOIS <arnodubois@sweetpunk.com> * [stable/unifi] Fixing feedbacks Signed-off-by: Arno DUBOIS <arnodubois@sweetpunk.com> * [stable/unifi] Adding captive portal ingress Signed-off-by: Arno DUBOIS <arnodubois@sweetpunk.com> * [stable/unifi] Better table formatting Signed-off-by: Arno DUBOIS <arnodubois@sweetpunk.com> * [stable/unifi] Fixed ingress Signed-off-by: Arno DUBOIS <arnodubois@sweetpunk.com> Co-authored-by: Arno DUBOIS <arnodubois@sweetpunk.com> Signed-off-by: Miguel Mingorance <miguel.mingorance@deliveryhero.com>
- Loading branch information
1 parent
569f460
commit 48c644b
Showing
7 changed files
with
255 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{{- if (and .Values.captivePortalService.ingress.enabled (not .Values.unifiedService.enabled)) }} | ||
{{- $fullName := include "unifi.fullname" . -}} | ||
{{- $ingressPath := .Values.captivePortalService.ingress.path -}} | ||
{{- $unifiedServiceEnabled := .Values.unifiedService.enabled -}} | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ $fullName }}-captive | ||
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.captivePortalService.ingress.annotations }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.captivePortalService.ingress.tls }} | ||
tls: | ||
{{- range .Values.captivePortalService.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
{{- range .Values.captivePortalService.ingress.hosts }} | ||
- host: {{ . }} | ||
http: | ||
paths: | ||
- path: {{ $ingressPath }} | ||
backend: | ||
serviceName: {{ $fullName }}-captivePortalService | ||
servicePort: captive-http | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{{ if (and .Values.captivePortalService.enabled (not .Values.unifiedService.enabled)) }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "unifi.fullname" . }}-captivePortalService | ||
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 }} | ||
{{- if .Values.captivePortalService.labels }} | ||
{{ toYaml .Values.captivePortalService.labels | indent 4 }} | ||
{{- end }} | ||
{{- with .Values.captivePortalService.annotations }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if (or (eq .Values.captivePortalService.type "ClusterIP") (empty .Values.captivePortalService.type)) }} | ||
type: ClusterIP | ||
{{- if .Values.captivePortalService.clusterIP }} | ||
clusterIP: {{ .Values.captivePortalService.clusterIP }} | ||
{{end}} | ||
{{- else if eq .Values.captivePortalService.type "LoadBalancer" }} | ||
type: {{ .Values.captivePortalService.type }} | ||
{{- if .Values.captivePortalService.loadBalancerIP }} | ||
loadBalancerIP: {{ .Values.captivePortalService.loadBalancerIP }} | ||
{{- end }} | ||
{{- if .Values.captivePortalService.loadBalancerSourceRanges }} | ||
loadBalancerSourceRanges: | ||
{{ toYaml .Values.captivePortalService.loadBalancerSourceRanges | indent 4 }} | ||
{{- end -}} | ||
{{- else }} | ||
type: {{ .Values.captivePortalService.type }} | ||
{{- end }} | ||
{{- if .Values.captivePortalService.externalIPs }} | ||
externalIPs: | ||
{{ toYaml .Values.captivePortalService.externalIPs | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.captivePortalService.externalTrafficPolicy }} | ||
externalTrafficPolicy: {{ .Values.captivePortalService.externalTrafficPolicy }} | ||
{{- end }} | ||
ports: | ||
- port: {{ .Values.captivePortalService.http }} | ||
targetPort: captive-http | ||
protocol: TCP | ||
name: captive-http | ||
{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.nodePorts.http))) }} | ||
nodePort: {{.Values.captivePortalService.nodePorts.http}} | ||
{{ end }} | ||
- port: {{ .Values.captivePortalService.https }} | ||
targetPort: captive-https | ||
protocol: TCP | ||
name: captive-https | ||
{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.nodePorts.https))) }} | ||
nodePort: {{.Values.captivePortalService.nodePorts.https}} | ||
{{ end }} | ||
selector: | ||
app.kubernetes.io/name: {{ include "unifi.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters