Traefik fixes (#659)

* fix chain middleware for traefik

* try adding portal button fix to dynamically fetch traefik port

* try hook quote

* correctly quote namespace name

* common version bump
This commit is contained in:
Kjeld Schouten-Lebbing
2021-07-05 18:13:44 +02:00
committed by GitHub
parent e4794ca02b
commit 224efec466
7 changed files with 33 additions and 5 deletions

View File

@@ -18,4 +18,4 @@ maintainers:
name: common
sources:
type: library
version: 6.5.1
version: 6.5.2

View File

@@ -10,6 +10,7 @@
{{- $protocol := "https" }}
{{- $portProtocol := "" }}
{{- $path := "/" }}
{{- $ingressport := 443 }}
{{- if $ingr }}
{{- if $ingr.enabled }}
@@ -28,8 +29,17 @@
{{- end }}
{{- end }}
{{- if and ( .Values.portal.ingressPort ) ( ne $host "$node_ip" ) }}
{{- $port = .Values.portal.ingressPort }}
{{- $traefikportalhook := lookup "v1" "ConfigMap" "traefikmiddlewares" "portalhook" }}
{{- if .Values.portal.ingressPort }}
{{- $ingressport = .Values.portal.ingressPort }}
{{- else if $traefikportalhook }}
{{- if $traefikportalhook.data.websecureport }}
{{- $ingressport = ( index $traefikportalhook.data "websecureport" ) }}
{{- end }}
{{- end }}
{{- if ne $host "$node_ip" }}
{{- $port = $ingressport }}
{{- else if eq $host "$node_ip" }}
{{- if eq $primaryService.type "NodePort" }}
{{- $port = $primaryPort.nodePort }}

View File

@@ -26,4 +26,4 @@ sources:
- https://traefik.io/
type: application
upstream_version: v9.19.2
version: 6.5.4
version: 6.5.5

View File

@@ -327,3 +327,6 @@ priorityClassName: ""
securityContext:
capabilities:
drop: [ALL]
portalhook:
enabled: true

View File

@@ -11,6 +11,6 @@ spec:
chain:
middlewares:
{{ range $index, $chainData := .Values.middlewares.chainmiddlewares }}
- name: {{ $chainData.name }}
- name: {{ printf "%v-%v@%v" "traefikmiddlewares" $chainData.name "kubernetescrd" }}
{{ end }}
{{ end }}

View File

@@ -0,0 +1,12 @@
{{- if .Values.portalhook.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: portalhook
namespace: traefikmiddlewares
data:
websecureport: {{ .Values.ports.websecure.exposedPort | quote }}
{{- end }}

View File

@@ -433,3 +433,6 @@ middlewares:
rateLimit: []
# average: 300
# burst: 200
portalhook:
enabled: true