diff --git a/infrastructure/traefik-app.yaml b/infrastructure/traefik-app.yaml index 57e2c34..34e7417 100644 --- a/infrastructure/traefik-app.yaml +++ b/infrastructure/traefik-app.yaml @@ -14,7 +14,19 @@ spec: helm: values: | deployment: - replicas: 2 + 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 service: enabled: true type: LoadBalancer diff --git a/infrastructure/traefik-pdb-app.yaml b/infrastructure/traefik-pdb-app.yaml new file mode 100644 index 0000000..0845818 --- /dev/null +++ b/infrastructure/traefik-pdb-app.yaml @@ -0,0 +1,27 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: traefik-pdb + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "0" # Nach Traefik Deployment +spec: + project: default + source: + repoURL: https://git.cloud-infra.prod.openmailserver.de/stabify/gitops.git + targetRevision: HEAD + path: infrastructure + directory: + recurse: false + include: | + traefik-pdb.yaml + destination: + server: https://kubernetes.default.svc + namespace: traefik-system + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + - ServerSideApply=true diff --git a/infrastructure/traefik-pdb.yaml b/infrastructure/traefik-pdb.yaml new file mode 100644 index 0000000..14e3462 --- /dev/null +++ b/infrastructure/traefik-pdb.yaml @@ -0,0 +1,12 @@ +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: traefik + namespace: traefik-system + labels: + app.kubernetes.io/name: traefik +spec: + minAvailable: 1 # Mindestens 1 Pod muss immer verfügbar sein + selector: + matchLabels: + app.kubernetes.io/name: traefik