Reorganized traefik

This commit is contained in:
2025-02-17 04:16:36 +01:00
parent 86c9ecaffc
commit c2b7d0db2e
13 changed files with 67 additions and 59 deletions

View File

@@ -0,0 +1,15 @@
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: default-headers
spec:
headers:
browserXssFilter: true
contentTypeNosniff: true
forceSTSHeader: true
stsIncludeSubdomains: true
stsPreload: true
stsSeconds: 15552000
customFrameOptionsValue: SAMEORIGIN
customRequestHeaders:
X-Forwarded-Proto: https

View File

@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: traefik
resources:
- ./default-headers.yaml

View File

@@ -0,0 +1,63 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: traefik
namespace: traefik
spec:
chart:
spec:
chart: traefik
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: traefik
version: 31.1.1
interval: 1m0s
values:
deployment:
kind: DaemonSet
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
ports:
web:
redirectTo:
port: websecure
websecure:
middlewares:
- traefik-default-headers@kubernetescrd
providers:
kubernetesCRD:
allowCrossNamespace: true
ingressRoute:
dashboard:
enabled: true
entryPoints:
- websecure
matchRule: Host(`traefik.${domain}`)
middlewares:
- name: forwardauth-authelia
namespace: authelia
tls:
secretName: ${domain//./-}-tls
# This is needed in order to properly forward the real ip to each service
# There are likely better ways of handling that, but for now this works
# TODO(Tim): Figure out how to properly forward the IP
# hostNetwork: true
service:
spec:
externalTrafficPolicy: Local
# updateStrategy:
# rollingUpdate:
# maxUnavailable: 2
# maxSurge: 0

View File

@@ -0,0 +1,7 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: traefik
spec:
interval: 1m0s
url: https://traefik.github.io/charts

View File

@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: traefik
resources:
- ./namespace.yaml
- ./helm-repository.yaml
- ./helm-release.yaml

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: traefik