fix: anti-affinity rules

This commit is contained in:
jv 2026-05-19 17:25:51 -05:00
parent a256bd02bd
commit eadac604f7
2 changed files with 17 additions and 10 deletions

View File

@ -7,6 +7,11 @@ metadata:
app: php-website app: php-website
spec: spec:
replicas: 2 replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
selector: selector:
matchLabels: matchLabels:
app: php-website app: php-website
@ -17,14 +22,16 @@ spec:
spec: spec:
affinity: affinity:
podAntiAffinity: podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution: preferredDuringSchedulingIgnoredDuringExecution: # requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector: - weight: 100
matchExpressions: podAffinityTerm:
- key: app labelSelector:
operator: In matchExpressions:
values: - key: app
- php-website operator: In
topologyKey: "kubernetes.io/hostname" values:
- php-website
topologyKey: "kubernetes.io/hostname"
containers: containers:
- name: php-app - name: php-app
image: local-registry-svc.container-registry.svc.cluster.local:5000/php-website:latest image: local-registry-svc.container-registry.svc.cluster.local:5000/php-website:latest

View File

@ -28,7 +28,7 @@ resource "kubernetes_manifest" "container_registry" {
project = "default" project = "default"
source = { source = {
repoURL = "ssh://jv@192.168.100.68/home/jv/git-server/my-homelab-configs.git" repoURL = "ssh://jv@192.168.100.68/home/jv/git-server/my-homelab-configs.git"
targetRevision = "HEAD" targetRevision = "main"
path = "apps/container-registry" path = "apps/container-registry"
} }
destination = { destination = {
@ -64,7 +64,7 @@ resource "kubernetes_manifest" "production_website" {
project = "default" project = "default"
source = { source = {
repoURL = "ssh://jv@192.168.100.68/home/jv/git-server/my-homelab-configs.git" repoURL = "ssh://jv@192.168.100.68/home/jv/git-server/my-homelab-configs.git"
targetRevision = "HEAD" targetRevision = "main"
path = "apps/website" path = "apps/website"
} }
destination = { destination = {