Merge pull request #6533 from dokku/process-specific-traefik-middleware
Ensure all k3s traefik middleware resources are scoped to the process
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
{{- $processName := "PROCESS_NAME" }}
|
||||||
|
{{- $config := .Values.processes.PROCESS_NAME }}
|
||||||
|
{{- if $config.web.domains }}
|
||||||
---
|
---
|
||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
@@ -5,11 +8,13 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
dokku.com/managed: "true"
|
dokku.com/managed: "true"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/instance: {{ $.Values.global.app_name }}-redirect-to-https
|
app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $processName }}-redirect-to-https
|
||||||
|
app.kubernetes.io/name: {{ $processName }}
|
||||||
app.kubernetes.io/part-of: {{ $.Values.global.app_name }}
|
app.kubernetes.io/part-of: {{ $.Values.global.app_name }}
|
||||||
name: {{ $.Values.global.app_name}}-redirect-to-https
|
name: {{ $.Values.global.app_name}}-{{ $processName }}-redirect-to-https
|
||||||
namespace: {{ $.Values.global.namespace }}
|
namespace: {{ $.Values.global.namespace }}
|
||||||
spec:
|
spec:
|
||||||
redirectScheme:
|
redirectScheme:
|
||||||
scheme: https
|
scheme: https
|
||||||
permanent: true
|
permanent: true
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ spec:
|
|||||||
match: Host(`{{ $domain }}`)
|
match: Host(`{{ $domain }}`)
|
||||||
{{- if and $config.web.tls.enabled (and (eq $port_map.scheme "http") $port_map.redirect_to_https) }}
|
{{- if and $config.web.tls.enabled (and (eq $port_map.scheme "http") $port_map.redirect_to_https) }}
|
||||||
middlewares:
|
middlewares:
|
||||||
- name: {{ $.Values.global.app_name}}-redirect-to-https
|
- name: {{ $.Values.global.app_name}}-{{ $processName }}-redirect-to-https
|
||||||
namespace: {{ $.Values.global.namespace }}
|
namespace: {{ $.Values.global.namespace }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
services:
|
services:
|
||||||
|
|||||||
Reference in New Issue
Block a user