fix: anti-affinity rules
This commit is contained in:
parent
a256bd02bd
commit
eadac604f7
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue