added HA conf for argo, outline and traefik

This commit is contained in:
2026-01-19 00:25:51 +01:00
parent 3f4672684f
commit d6d1614660
6 changed files with 78 additions and 12 deletions

View File

@@ -16,3 +16,7 @@ spec:
automated:
prune: false # Safety: Don't delete ArgoCD resources not managed by this app
selfHeal: true
syncOptions:
- CreateNamespace=true
# WICHTIG: ServerSideApply für Patches
- ServerSideApply=true

View File

@@ -0,0 +1,38 @@
# ArgoCD HA Patch
# Patches das argocd-server Deployment für High Availability
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-server
namespace: argocd
spec:
replicas: 2 # HA: Mindestens 2 Replicas für Ausfallsicherheit
template:
spec:
affinity:
podAntiAffinity:
# Hard Rule: Pods müssen auf verschiedenen Nodes laufen
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- argocd-server
topologyKey: kubernetes.io/hostname
# WICHTIG: Controller flag für HA Mode
# --disable-auth sollte NICHT gesetzt werden in HA Mode
# --insecure wird bereits vom Standard-Manifest gesetzt
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: argocd-server
namespace: argocd
spec:
minAvailable: 1 # Mindestens 1 Pod muss immer verfügbar sein
selector:
matchLabels:
app.kubernetes.io/name: argocd-server

View File

@@ -3,4 +3,5 @@ kind: Kustomization
resources:
- external-secret.yaml
- argocd-cm.yaml
- argocd-rbac-cm.yaml
- argocd-rbac-cm.yaml
- argocd-ha-patch.yaml # HA: 2 Replicas + Anti-Affinity + PDB

View File

@@ -6,7 +6,7 @@ metadata:
labels:
app: outline
spec:
replicas: 1
replicas: 2 # HA: Mindestens 2 Replicas für Ausfallsicherheit
selector:
matchLabels:
app: outline
@@ -15,6 +15,17 @@ spec:
labels:
app: outline
spec:
affinity:
podAntiAffinity:
# Hard Rule: Pods müssen auf verschiedenen Nodes laufen
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- outline
topologyKey: kubernetes.io/hostname
containers:
- name: outline
image: outlinewiki/outline:latest

12
apps/outline/pdb.yaml Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: outline
namespace: outline
labels:
app: outline
spec:
minAvailable: 1 # Mindestens 1 Pod muss immer verfügbar sein
selector:
matchLabels:
app: outline

View File

@@ -17,16 +17,16 @@ spec:
replicas: 3 # HA: Einer pro Node
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- traefik
topologyKey: kubernetes.io/hostname
# WICHTIG: requiredDuringSchedulingIgnoredDuringExecution = Hard Rule
# Verhindert, dass Pods auf dem gleichen Node laufen
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- traefik
topologyKey: kubernetes.io/hostname
service:
enabled: true
type: LoadBalancer