automatically deploy traefik

This commit is contained in:
Remy Moll 2023-12-06 19:46:20 +01:00
parent 8d381d8b93
commit ab3dba75c5
12 changed files with 67 additions and 72 deletions

View File

@ -28,7 +28,7 @@ spec:
env: env:
- name: TZ - name: TZ
value: Europe/Berlin value: Europe/Berlin
image: adguard/adguardhome:v0.107.7 image: adguard/adguardhome:v0.107.41
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
livenessProbe: livenessProbe:
failureThreshold: 3 failureThreshold: 3

View File

@ -1,42 +1,15 @@
# apiVersion: traefik.containo.us/v1alpha1
# kind: Middleware
# metadata:
# name: authentik-auth
# namespace: adguard
# spec:
# forwardAuth:
# address: https://adguard.kluster.moll.re/outpost.goauthentik.io/auth/traefik
# trustForwardHeader: true
# authResponseHeaders:
# - X-authentik-username
# - X-authentik-groups
# - X-authentik-email
# - X-authentik-name
# - X-authentik-uid
# - X-authentik-jwt
# - X-authentik-meta-jwks
# - X-authentik-meta-outpost
# - X-authentik-meta-provider
# - X-authentik-meta-app
# - X-authentik-meta-version
# ---
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute kind: IngressRouteTCP
metadata: metadata:
name: adguard-ingress name: adguard-tls-ingress
namespace: adguard namespace: adguard
spec: spec:
entryPoints: entryPoints:
- websecure - dnsovertls
routes: routes:
- match: Host(`adguard.kluster.moll.re`) - match: HostSNI(`adguard.kluster.moll.re`)
kind: Rule
# middlewares:
# - name: authentik-auth
services: services:
- name: adguard-home - name: adguard-adguard-home-dns-tcp
port: 3000 port: 53
tls: tls:
certResolver: default-tls certResolver: default-tls

View File

@ -1,2 +0,0 @@
name: traefik
chart: traefik/traefik

View File

@ -2,7 +2,6 @@ apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: traefik-config name: traefik-config
namespace: traefik-system
data: data:
traefik.toml: | traefik.toml: |
[ping] [ping]
@ -69,6 +68,8 @@ data:
address = ":9100" address = ":9100"
[entryPoints.traefik] [entryPoints.traefik]
address = ":9000" address = ":9000"
[entryPoints.dnsovertls] # route dns over https to other pods but provide own certificate
address = ":853"
[metrics] [metrics]
[metrics.influxDB2] [metrics.influxDB2]

View File

@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- pvc.yaml
- configmap.yaml
namespace: traefik-system
helmCharts:
- name: traefik
releaseName: traefik
version: 26.0.0
valuesFile: values.yaml
repo: https://helm.traefik.io/traefik
# - name: telegraf
# releaseName: telegraf?
# version: "?"
# valuesFile: telegraf.values.yaml
# repo: https://helm.influxdata.com/

View File

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

View File

@ -1,13 +1,10 @@
apiVersion: v1 apiVersion: v1
kind: PersistentVolume kind: PersistentVolume
metadata: metadata:
namespace: traefik-system
name: traefik-certificate name: traefik-certificate
spec: spec:
# storageClassName: fast
capacity: capacity:
storage: "10Mi" storage: "10Mi"
# volumeMode: Filesystem
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
nfs: nfs:
@ -17,10 +14,8 @@ spec:
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
namespace: traefik-system
name: traefik-certificate name: traefik-certificate
spec: spec:
# storageClassName: fast
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:

View File

@ -1,2 +0,0 @@
name: telegraf-traefik
chart: influxdata/telegraf

View File

@ -1,11 +1,3 @@
# Default values for Traefik
image:
name: traefik
# defaults to appVersion
tag: ""
pullPolicy: IfNotPresent
# #
# Configure the deployment # Configure the deployment
# #
@ -158,12 +150,6 @@ volumes: []
# name: traefik-config # name: traefik-config
# - name: public-cert
# mountPath: "/certs"
# type: secret
# - name: '{{ printf "%s-configs" .Release.Name }}'
# mountPath: "/config"
# type: configMap
# Additional volumeMounts to add to the Traefik container # Additional volumeMounts to add to the Traefik container
additionalVolumeMounts: additionalVolumeMounts:
@ -192,24 +178,17 @@ additionalArguments: []
env: env:
- name: TZ - name: TZ
value: "Europe/Berlin" value: "Europe/Berlin"
# - name: SOME_VAR
# value: some-var-value
# - name: SOME_VAR_FROM_CONFIG_MAP
# valueFrom:
# configMapRef:
# name: configmap-name
# key: config-key
# - name: SOME_SECRET
# valueFrom:
# secretKeyRef:
# name: secret-name
# key: secret-key
# Configure ports # Configure ports
ports: {} # leave unconfigured to use the values from the toml file ports:
# add a new one, the other ones are kept the same.
dnsovertls:
port: 853
expose: true
exposedPort: 853
protocol: TCP
envFrom: [] envFrom: []

View File

@ -5,10 +5,14 @@ namespace: argocd
resources: resources:
# infrastructure
- projects.yaml - projects.yaml
- nfs/ - nfs/
- backup/ - backup/
- argocd-imageupdate/ - argocd-imageupdate/
- traefik/
# simple apps
- whoami/ - whoami/
- journal/ - journal/
- immich/ - immich/

View File

@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: traefik-application
namespace: argocd
spec:
project: infrastructure
source:
repoURL: https://github.com/moll-re/k3s-infra.git
targetRevision: main
path: infrastructure/traefik-system
destination:
server: https://kubernetes.default.svc
namespace: traefik-system
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- application.yaml