added HA conf for argo, outline and traefik
This commit is contained in:
@@ -16,3 +16,7 @@ spec:
|
|||||||
automated:
|
automated:
|
||||||
prune: false # Safety: Don't delete ArgoCD resources not managed by this app
|
prune: false # Safety: Don't delete ArgoCD resources not managed by this app
|
||||||
selfHeal: true
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
|
# WICHTIG: ServerSideApply für Patches
|
||||||
|
- ServerSideApply=true
|
||||||
38
apps/argocd-config/argocd-ha-patch.yaml
Normal file
38
apps/argocd-config/argocd-ha-patch.yaml
Normal 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
|
||||||
@@ -3,4 +3,5 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- external-secret.yaml
|
- external-secret.yaml
|
||||||
- argocd-cm.yaml
|
- argocd-cm.yaml
|
||||||
- argocd-rbac-cm.yaml
|
- argocd-rbac-cm.yaml
|
||||||
|
- argocd-ha-patch.yaml # HA: 2 Replicas + Anti-Affinity + PDB
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app: outline
|
app: outline
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 2 # HA: Mindestens 2 Replicas für Ausfallsicherheit
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: outline
|
app: outline
|
||||||
@@ -15,6 +15,17 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: outline
|
app: outline
|
||||||
spec:
|
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:
|
containers:
|
||||||
- name: outline
|
- name: outline
|
||||||
image: outlinewiki/outline:latest
|
image: outlinewiki/outline:latest
|
||||||
|
|||||||
12
apps/outline/pdb.yaml
Normal file
12
apps/outline/pdb.yaml
Normal 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
|
||||||
@@ -17,16 +17,16 @@ spec:
|
|||||||
replicas: 3 # HA: Einer pro Node
|
replicas: 3 # HA: Einer pro Node
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinity:
|
podAntiAffinity:
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
# WICHTIG: requiredDuringSchedulingIgnoredDuringExecution = Hard Rule
|
||||||
- weight: 100
|
# Verhindert, dass Pods auf dem gleichen Node laufen
|
||||||
podAffinityTerm:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
labelSelector:
|
- labelSelector:
|
||||||
matchExpressions:
|
matchExpressions:
|
||||||
- key: app.kubernetes.io/name
|
- key: app.kubernetes.io/name
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- traefik
|
- traefik
|
||||||
topologyKey: kubernetes.io/hostname
|
topologyKey: kubernetes.io/hostname
|
||||||
service:
|
service:
|
||||||
enabled: true
|
enabled: true
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
|
|||||||
Reference in New Issue
Block a user