From eadac604f7943b5aac89841cc708a5fe0fd952a7 Mon Sep 17 00:00:00 2001 From: jv Date: Tue, 19 May 2026 17:25:51 -0500 Subject: [PATCH] fix: anti-affinity rules --- apps/website/web-app.yaml | 23 +++++++++++++++-------- bootstrap/apps/main.tf | 4 ++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/apps/website/web-app.yaml b/apps/website/web-app.yaml index f547f23..51260c1 100644 --- a/apps/website/web-app.yaml +++ b/apps/website/web-app.yaml @@ -7,6 +7,11 @@ metadata: app: php-website spec: replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 selector: matchLabels: app: php-website @@ -17,14 +22,16 @@ spec: spec: affinity: podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - php-website - topologyKey: "kubernetes.io/hostname" + preferredDuringSchedulingIgnoredDuringExecution: # requiredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - php-website + topologyKey: "kubernetes.io/hostname" containers: - name: php-app image: local-registry-svc.container-registry.svc.cluster.local:5000/php-website:latest diff --git a/bootstrap/apps/main.tf b/bootstrap/apps/main.tf index 9c9585e..cd63f69 100644 --- a/bootstrap/apps/main.tf +++ b/bootstrap/apps/main.tf @@ -28,7 +28,7 @@ resource "kubernetes_manifest" "container_registry" { project = "default" source = { repoURL = "ssh://jv@192.168.100.68/home/jv/git-server/my-homelab-configs.git" - targetRevision = "HEAD" + targetRevision = "main" path = "apps/container-registry" } destination = { @@ -64,7 +64,7 @@ resource "kubernetes_manifest" "production_website" { project = "default" source = { repoURL = "ssh://jv@192.168.100.68/home/jv/git-server/my-homelab-configs.git" - targetRevision = "HEAD" + targetRevision = "main" path = "apps/website" } destination = {