FEAT(web-apps): enable HA with replica 2 and soft anti-affinity
- Add replicaCount: 2 to all web applications - Add soft pod anti-affinity for node distribution - Update chart template to handle affinity correctly - Configure affinity for todo, portfolio, jovies, jotion, joossam, joossam-dev, jaejadle, jaejadle-dev
This commit is contained in:
@@ -76,7 +76,20 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.affinity }}
|
{{- with .Values.affinity }}
|
||||||
affinity:
|
affinity:
|
||||||
|
{{- if and .podAntiAffinity .podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution }}
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
{{- range .podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution }}
|
||||||
|
- weight: {{ .weight }}
|
||||||
|
podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ include "web-app.fullname" $ }}
|
||||||
|
topologyKey: {{ .podAffinityTerm.topologyKey }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.tolerations }}
|
{{- with .Values.tolerations }}
|
||||||
tolerations:
|
tolerations:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ imagePullSecrets:
|
|||||||
- name: ghcr-secret
|
- name: ghcr-secret
|
||||||
|
|
||||||
# Replicas
|
# Replicas
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
|
|
||||||
# Container port
|
# Container port
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
@@ -106,5 +106,10 @@ nodeSelector: {}
|
|||||||
# Tolerations
|
# Tolerations
|
||||||
tolerations: []
|
tolerations: []
|
||||||
|
|
||||||
# Affinity
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
affinity: {}
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ image:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: ghcr-secret
|
- name: ghcr-secret
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -100,3 +100,11 @@ externalSecret:
|
|||||||
remoteRef:
|
remoteRef:
|
||||||
key: jaejadle-dev
|
key: jaejadle-dev
|
||||||
property: CODE
|
property: CODE
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ image:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: ghcr-secret
|
- name: ghcr-secret
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -100,3 +100,11 @@ externalSecret:
|
|||||||
remoteRef:
|
remoteRef:
|
||||||
key: jaejadle
|
key: jaejadle
|
||||||
property: CODE
|
property: CODE
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ image:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: ghcr-secret
|
- name: ghcr-secret
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 8000
|
containerPort: 8000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -56,3 +56,11 @@ healthCheck:
|
|||||||
|
|
||||||
externalSecret:
|
externalSecret:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ image:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: ghcr-secret
|
- name: ghcr-secret
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 8000
|
containerPort: 8000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -56,3 +56,11 @@ healthCheck:
|
|||||||
|
|
||||||
externalSecret:
|
externalSecret:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ image:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: ghcr-secret
|
- name: ghcr-secret
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -82,3 +82,11 @@ externalSecret:
|
|||||||
remoteRef:
|
remoteRef:
|
||||||
key: jotion
|
key: jotion
|
||||||
property: DATABASE_URL
|
property: DATABASE_URL
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ image:
|
|||||||
tag: latest # Updated by ArgoCD Image Updater
|
tag: latest # Updated by ArgoCD Image Updater
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -62,3 +62,11 @@ env:
|
|||||||
|
|
||||||
externalSecret:
|
externalSecret:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ image:
|
|||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -66,3 +66,11 @@ env:
|
|||||||
|
|
||||||
externalSecret:
|
externalSecret:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ image:
|
|||||||
# No imagePullSecrets needed (public or already configured)
|
# No imagePullSecrets needed (public or already configured)
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 2
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@@ -82,3 +82,11 @@ externalSecret:
|
|||||||
remoteRef:
|
remoteRef:
|
||||||
key: todo
|
key: todo
|
||||||
property: DATABASE_URL
|
property: DATABASE_URL
|
||||||
|
|
||||||
|
# Affinity - Soft Anti-Affinity to spread pods across nodes
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
|||||||
Reference in New Issue
Block a user