mirror of
https://github.com/vhaudiquet/homeprod.git
synced 2026-09-21 16:36:05 +00:00
refactor: consolidate kubernetes categories
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
# Caddy Routes - External ConfigMap
|
||||
# This file contains all route definitions, imported by the main Caddyfile.
|
||||
# Edit this file to add/modify routes.
|
||||
#
|
||||
# Certificate files are mounted from cert-manager-managed TLS Secrets
|
||||
# at /etc/caddy/certs/
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: caddy-routes
|
||||
namespace: caddy
|
||||
labels:
|
||||
app.kubernetes.io/name: caddy
|
||||
app.kubernetes.io/component: routes
|
||||
data:
|
||||
Caddyfile: |
|
||||
vhaudiquet.fr {
|
||||
tls /etc/caddy/certs/vhaudiquet-fr/tls.crt /etc/caddy/certs/vhaudiquet-fr/tls.key
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
|
||||
*.vhaudiquet.fr {
|
||||
tls /etc/caddy/certs/wildcard-vhaudiquet-fr/tls.crt /etc/caddy/certs/wildcard-vhaudiquet-fr/tls.key
|
||||
|
||||
# Kubernetes services (via Traefik)
|
||||
@authentik host authentik.vhaudiquet.fr
|
||||
|
||||
@auth-nook host auth-nook.vhaudiquet.fr
|
||||
@nook-mg host n.vhaudiquet.fr
|
||||
@nook host nook.vhaudiquet.fr
|
||||
@sse-nook host sse-nook.vhaudiquet.fr
|
||||
|
||||
@gitea host git.vhaudiquet.fr
|
||||
|
||||
@flux-wh host flux-webhook.vhaudiquet.fr
|
||||
|
||||
@umami host umami.vhaudiquet.fr
|
||||
|
||||
handle @authentik {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
handle @auth-nook {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
handle @nook-mg {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
handle @nook {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
handle @sse-nook {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
handle @gitea {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
handle @flux-wh {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
handle @umami {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
|
||||
# Docker VM services (via Docker Traefik)
|
||||
@alexscript host alexscript.vhaudiquet.fr
|
||||
@clips host clips.vhaudiquet.fr
|
||||
@jellyfin host flix.vhaudiquet.fr
|
||||
|
||||
handle @alexscript {
|
||||
reverse_proxy 10.1.2.212:80
|
||||
}
|
||||
handle @clips {
|
||||
reverse_proxy 10.1.2.212:80
|
||||
}
|
||||
handle @jellyfin {
|
||||
reverse_proxy 10.1.2.212:80
|
||||
}
|
||||
|
||||
# Stalwart WebUI (now in Kubernetes, via k8s Traefik)
|
||||
@mail host mail.vhaudiquet.fr
|
||||
handle @mail {
|
||||
reverse_proxy traefik.traefik.svc.cluster.local.:80
|
||||
}
|
||||
}
|
||||
|
||||
semery.fr {
|
||||
tls /etc/caddy/certs/semery-fr/tls.crt /etc/caddy/certs/semery-fr/tls.key
|
||||
reverse_proxy 10.1.2.212:80
|
||||
}
|
||||
|
||||
buildpath.win {
|
||||
tls /etc/caddy/certs/buildpath-win/tls.crt /etc/caddy/certs/buildpath-win/tls.key
|
||||
reverse_proxy 10.1.2.212:80
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
# Certificates managed by cert-manager
|
||||
# These will automatically renew before expiry
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: vhaudiquet-fr
|
||||
namespace: caddy
|
||||
spec:
|
||||
secretName: vhaudiquet-fr-tls
|
||||
issuerRef:
|
||||
name: letsencrypt-production
|
||||
kind: ClusterIssuer
|
||||
commonName: vhaudiquet.fr
|
||||
dnsNames:
|
||||
- vhaudiquet.fr
|
||||
duration: 2160h # 90 days
|
||||
renewBefore: 360h # 15 days before expiry
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: wildcard-vhaudiquet-fr
|
||||
namespace: caddy
|
||||
spec:
|
||||
secretName: wildcard-vhaudiquet-fr-tls
|
||||
issuerRef:
|
||||
name: letsencrypt-production
|
||||
kind: ClusterIssuer
|
||||
commonName: "*.vhaudiquet.fr"
|
||||
dnsNames:
|
||||
- "*.vhaudiquet.fr"
|
||||
duration: 2160h # 90 days
|
||||
renewBefore: 360h # 15 days before expiry
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: semery-fr
|
||||
namespace: caddy
|
||||
spec:
|
||||
secretName: semery-fr-tls
|
||||
issuerRef:
|
||||
name: letsencrypt-production
|
||||
kind: ClusterIssuer
|
||||
commonName: semery.fr
|
||||
dnsNames:
|
||||
- semery.fr
|
||||
duration: 2160h # 90 days
|
||||
renewBefore: 360h # 15 days before expiry
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: wildcard-semery-fr
|
||||
namespace: caddy
|
||||
spec:
|
||||
secretName: wildcard-semery-fr-tls
|
||||
issuerRef:
|
||||
name: letsencrypt-production
|
||||
kind: ClusterIssuer
|
||||
commonName: "*.semery.fr"
|
||||
dnsNames:
|
||||
- "*.semery.fr"
|
||||
duration: 2160h # 90 days
|
||||
renewBefore: 360h # 15 days before expiry
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: buildpath-win
|
||||
namespace: caddy
|
||||
spec:
|
||||
secretName: buildpath-win-tls
|
||||
issuerRef:
|
||||
name: letsencrypt-production
|
||||
kind: ClusterIssuer
|
||||
commonName: buildpath.win
|
||||
dnsNames:
|
||||
- buildpath.win
|
||||
duration: 2160h # 90 days
|
||||
renewBefore: 360h # 15 days before expiry
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: caddy
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- repository.yaml
|
||||
- release.yaml
|
||||
- certificates.yaml
|
||||
- caddyfile.yaml
|
||||
secretGenerator:
|
||||
- name: caddy-values
|
||||
files:
|
||||
- values.yaml=values.yaml
|
||||
configurations:
|
||||
- kustomizeconfig.yaml
|
||||
@@ -0,0 +1,6 @@
|
||||
nameReference:
|
||||
- kind: Secret
|
||||
version: v1
|
||||
fieldSpecs:
|
||||
- path: spec/valuesFrom/name
|
||||
kind: HelmRelease
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: caddy
|
||||
labels:
|
||||
app.kubernetes.io/name: caddy
|
||||
app.kubernetes.io/component: edge-proxy
|
||||
@@ -0,0 +1,30 @@
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: caddy
|
||||
namespace: caddy
|
||||
spec:
|
||||
interval: 1m
|
||||
chart:
|
||||
spec:
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: caddy
|
||||
namespace: caddy
|
||||
chart: caddy
|
||||
interval: 1m
|
||||
version: "0.7.1"
|
||||
valuesFrom:
|
||||
- kind: Secret
|
||||
name: caddy-values
|
||||
# Patch the Service to add loadBalancerIP since the chart doesn't support it
|
||||
postRenderers:
|
||||
- kustomize:
|
||||
patches:
|
||||
- target:
|
||||
kind: Service
|
||||
name: caddy
|
||||
patch: |
|
||||
- op: add
|
||||
path: /spec/loadBalancerIP
|
||||
value: "10.1.2.152"
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: caddy
|
||||
namespace: caddy
|
||||
spec:
|
||||
interval: 1m
|
||||
url: https://charts.alekc.dev/
|
||||
@@ -0,0 +1,148 @@
|
||||
# Caddy Edge Proxy
|
||||
replicaCount: 2
|
||||
# Listen on standard HTTP port
|
||||
listenPort: 80
|
||||
# Enable HTTPS
|
||||
https:
|
||||
enabled: true
|
||||
port: 443
|
||||
image:
|
||||
repository: caddy
|
||||
pullPolicy: IfNotPresent
|
||||
tagSuffix: ""
|
||||
tag: 2.11.2
|
||||
service:
|
||||
type: LoadBalancer
|
||||
# Cluster (not Local) so any node can forward to pods on any other node.
|
||||
externalTrafficPolicy: Cluster
|
||||
# Disable ingress - Caddy IS the edge proxy
|
||||
ingress:
|
||||
enabled: false
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 256Mi
|
||||
# Caddy needs root to bind to ports 80/443 and write runtime data
|
||||
# Using restrictive security context causes "operation not permitted"
|
||||
podSecurityContext: {}
|
||||
securityContext: {}
|
||||
health:
|
||||
path: /
|
||||
port: 9999
|
||||
# Extra volumes: TLS certificates from cert-manager + external routes ConfigMap
|
||||
volumes:
|
||||
- name: vhaudiquet-fr-tls
|
||||
secret:
|
||||
secretName: ENC[AES256_GCM,data:91g6xGYke1FlteHJX17r6w4=,iv:uquY66VZIAPnFse/maIQUcdRVFXUfb/M9tFvNqdgSfE=,tag:P4/D7jpUgEhcOnoxk+QO9A==,type:str]
|
||||
optional: ENC[AES256_GCM,data:KgTxuQ==,iv:KIxXxFGKVA07qMVYZIcBE2BnYTtLl9tFrOZE57xIHXk=,tag:lCyA/TXsxTUZSZDveQSDdg==,type:bool]
|
||||
- name: wildcard-vhaudiquet-fr-tls
|
||||
secret:
|
||||
secretName: ENC[AES256_GCM,data:cZlwLn0jjz4GGX2z/w4ooeWBbyOAMZ9UHgc=,iv:Yh4wuMcyDekHzGUxCLldnAOaqLPS45YvybwhdZd5kGo=,tag:Z/jti3YF0/wdsrC9PxHVgw==,type:str]
|
||||
optional: ENC[AES256_GCM,data:ZULOMg==,iv:qjb4nvvineVsTEp35JxPcMRDS5Ij4zIsc7PI+d6/M60=,tag:LcOjEqypcQLrBpXBrpRvOw==,type:bool]
|
||||
# semery.fr certs from cert-manager (OVH DNS-01)
|
||||
- name: semery-fr-tls
|
||||
secret:
|
||||
secretName: ENC[AES256_GCM,data:rxGGzrGRZPfzNjFIIQ==,iv:wvgWZIbAoBeJ/7/F4WeBuCHi1I4xHxwLtJZD7/SwV4Y=,tag:n8Zr+hwkD/Vm0LI/Se2TvQ==,type:str]
|
||||
optional: ENC[AES256_GCM,data:5M+93g==,iv:KEMghZxEKvH+3vM/mtuVCIvzb2X19quX8Kd+oVJp+y4=,tag:mRqR+Fj86AWfGnvlTzRh2w==,type:bool]
|
||||
- name: wildcard-semery-fr-tls
|
||||
secret:
|
||||
secretName: ENC[AES256_GCM,data:L6rjVVVtpOne6oog+Ru07ryaS2aVzg==,iv:Qg8wv1LUeaKKGzHpe2HHGR5GzJXYYog9HPJrcPhrMq4=,tag:8Z2yVeFv0mLZlQ9Yn3oRVg==,type:str]
|
||||
optional: ENC[AES256_GCM,data:Na+sDg==,iv:3r1+mX+APihx5w5sU3/Rnyl4/ZjO8lO3jAcaBuG4B/8=,tag:WKYxuFraq8+659StfI79FA==,type:bool]
|
||||
- name: buildpath-win-tls
|
||||
secret:
|
||||
secretName: ENC[AES256_GCM,data:cHgBMV3iWihTRS2h4Gu9CZY=,iv:IttOh8Ra68dwxlkT8hZ4vhg8uEwDvByjFv/pT5ae9jM=,tag:+7xH89jLUMfJB/mJzyuE3Q==,type:str]
|
||||
optional: ENC[AES256_GCM,data:QVSy/Q==,iv:25ldKY94OaF5IMSHtCzNacsBKA3MHTOHQtGVe0fY9g4=,tag:3fl1RCkfEjF86fMsYv8W4g==,type:bool]
|
||||
- name: routes
|
||||
configMap:
|
||||
name: caddy-routes
|
||||
# Extra volume mounts - each secret mounted as a directory with tls.crt/tls.key
|
||||
volumeMounts:
|
||||
- name: vhaudiquet-fr-tls
|
||||
mountPath: /etc/caddy/certs/vhaudiquet-fr
|
||||
readOnly: true
|
||||
- name: wildcard-vhaudiquet-fr-tls
|
||||
mountPath: /etc/caddy/certs/wildcard-vhaudiquet-fr
|
||||
readOnly: true
|
||||
- name: semery-fr-tls
|
||||
mountPath: /etc/caddy/certs/semery-fr
|
||||
readOnly: true
|
||||
- name: wildcard-semery-fr-tls
|
||||
mountPath: /etc/caddy/certs/wildcard-semery-fr
|
||||
readOnly: true
|
||||
- name: buildpath-win-tls
|
||||
mountPath: /etc/caddy/certs/buildpath-win
|
||||
readOnly: true
|
||||
- name: routes
|
||||
mountPath: /etc/caddy/routes
|
||||
readOnly: true
|
||||
# Caddy configuration
|
||||
config:
|
||||
debug: false
|
||||
# Global options (goes inside the global {} block)
|
||||
global: |
|
||||
auto_https off
|
||||
# The main Caddyfile content - imports routes from external ConfigMap
|
||||
# This keeps routes in a separate, easily editable file
|
||||
caddyFile: |
|
||||
:80 {
|
||||
redir https://{host}{uri} permanent
|
||||
}
|
||||
|
||||
import /etc/caddy/routes/Caddyfile
|
||||
affinity:
|
||||
# Prefer non-failover nodes in normal operation
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: ENC[AES256_GCM,data:U5edeFnG3Eu+7hhCmkUZXTf1wrU=,iv:hczbYIbQAq1XSCughZdVa9ChQ7nv62elsMtrUzCVV6Y=,tag:/Uh3rsO43oSfyX4fFCEujQ==,type:str]
|
||||
operator: NotIn
|
||||
values:
|
||||
- "true"
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: caddy
|
||||
topologyKey: kubernetes.io/hostname
|
||||
tolerations:
|
||||
# Tolerate the failover taint so caddy CAN schedule on p330 (small-node-1).
|
||||
- key: ENC[AES256_GCM,data:wGARNk8BSuSn,iv:K1uKmlmQYv0/Y2lXP6JvIi1kbx1VwIb2m3XK1o+OHSI=,tag:PETfq6sO58vkFZmJBWJvDA==,type:str]
|
||||
operator: Equal
|
||||
value: ENC[AES256_GCM,data:2Z/x7/cf6CQ=,iv:yuFeoo3LvfTL2yDpCbOEb994lGao7B/mQnFKrdxEtlk=,tag:xN7t4jD6wZV8e92959BFoQ==,type:str]
|
||||
effect: NoSchedule
|
||||
- key: ENC[AES256_GCM,data:4mk1b0YQAmUOZ+0k7PsilvYd/oXlCjS4HT8QzfyZpUNSjla5vA==,iv:GhJGcDRX25UsKH3B8ZKPLUJOoo4+EqnzlNuBfy8ggeU=,tag:pzY8xT1m++02YD8YRPFpog==,type:str]
|
||||
operator: Exists
|
||||
effect: NoSchedule
|
||||
sops:
|
||||
lastmodified: "2026-07-25T12:06:27Z"
|
||||
mac: ENC[AES256_GCM,data:uIOoHpLdiuIOF82w84PsziKyAglkY02OrGU0sigjnhyt+6S9ryy74oiJivzxtniTevsv2PKecN0uXABKzabp+ysY7/uDix/lE0KzoUs6sYA5kVfUj1JPoDQ6bQxoi0y8zKeOqMoqHwIAs+2N2VEriqtRxn+4L3kbTrbe9CFtxIg=,iv:5ZIt9yXKJo5pF9ghi+uVs7zxsdLtQ+pTlc37FKVz2iU=,tag:sTOq1pJh0KQ06soBcmcWRA==,type:str]
|
||||
pgp:
|
||||
- created_at: "2026-07-25T12:06:27Z"
|
||||
enc: |-
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
||||
hQIMA7uy4qQr71wiARAAvv+DByIWPPLBdqAB39jdZPkrWzVN/7TJ3DU8q380NNMI
|
||||
2w2I28Ee3iXl4e/Qj66fx8U8NGwdYo/j+mUjIddBjiJB5xzu97k+nT4toDocutGT
|
||||
bOI4KZP/J7vh+spb6TMJvH39IGLOYH6N2NagRD6r15kd37ddoRbV8OFTZXvXf524
|
||||
d3+PbqQz9FoulLy+Yt8tWWXD1MpqRbIHL65dAhLF0vZRxUVcnRmg77ZX2Q1yD7Wq
|
||||
i8c0Pe1dhqg6ig+njshiC7HkWOQoINYzk012hz+Cid5JZAIyxsqxkdoFUWHeWI0h
|
||||
u3XUpjjxj+eg0YlnAqrnK16B6+pscZWjEgHJEmrGQo8AGFMdALoubv+8nGiywNZP
|
||||
tqM9oT1ePa0pIJNzhNgFWGkwwuyH4jPXrRji9fpLASAihsM1WQIh3smd373C0Z/W
|
||||
sQYFTS9B6FUCCdDPA/St0Rd/RHFW+eJPC6Jh4728Pqa67FjnuIVB5VJ33Dgpl8OE
|
||||
kEyY3WvtoYOaw+6VqWetg79sCruibmlenDWSrT8VQ8ksk/YIj+iicPnI/BY5S2Wz
|
||||
j2s1Lpvvhr/gZvF7z+vfhX1Fn28xIg5/gkcoYSKgFhqxG69IlPbZsr/D2oWyeygd
|
||||
tIp/D1yHGFJ1Cb56qr400t9xF5BD605rf/Aczg8mdvI41jGvmECQrSKHsxI25xLS
|
||||
XgEVhCAm6HDAKEhjnm1wAZG8DJRhcrSLqLq7SPKJaTPJpjeQwXOb6OIs9ugQx9ON
|
||||
w96InR1VMsEUlh1EWBXUqBgQgyDIIEAa+wHBnY7U06fkazN6lcLkAp17yTitTEk=
|
||||
=gULt
|
||||
-----END PGP MESSAGE-----
|
||||
fp: DC6910268E657FF70BA7EC289974494E76938DDC
|
||||
encrypted_regex: ^(password|value|ssh-key|api-key|user|username|privateKey|clientSecret|clientId|apiKey|extraArgs.*|.*Secret.*|extraEnvVars|.*SECRET.*|.*secret.*|key|.*Password|.*\.ya?ml)$
|
||||
version: 3.10.2
|
||||
Reference in New Issue
Block a user