aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lucas <jflos@sonoris.net>2023-11-22 14:10:52 +0000
committerGerrit Code Review <gerrit@onap.org>2023-11-22 14:10:52 +0000
commit6c2178c6f5cd5631677ac2a03a7c493c0a015e8c (patch)
treed29367d4badb26fdda3778bf6a1f92ac44d12fdc
parent55238cab360306f880d17b8eeb28e618c51baed8 (diff)
parent64f95b155fd2101d3e60872bf2d650954de8a6fa (diff)
Merge "[STRIMZI] Add podAntiAffinity to kafka deployment"
-rw-r--r--kubernetes/strimzi/templates/strimzi-kafka.yaml24
-rw-r--r--kubernetes/strimzi/values.yaml3
2 files changed, 27 insertions, 0 deletions
diff --git a/kubernetes/strimzi/templates/strimzi-kafka.yaml b/kubernetes/strimzi/templates/strimzi-kafka.yaml
index 4071aa03a6..a808b84441 100644
--- a/kubernetes/strimzi/templates/strimzi-kafka.yaml
+++ b/kubernetes/strimzi/templates/strimzi-kafka.yaml
@@ -72,6 +72,18 @@ spec:
securityContext:
runAsUser: 0
fsGroup: 0
+ {{- if .Values.affinity.podAntiAffinity.enabled }}
+ affinity:
+ podAntiAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ - labelSelector:
+ matchExpressions:
+ - key: strimzi.io/name
+ operator: In
+ values:
+ - {{ include "common.fullname" . }}-kafka
+ topologyKey: "kubernetes.io/hostname"
+ {{- end }}
config:
default.replication.factor: {{ .Values.replicaCount }}
min.insync.replicas: {{ (eq 1.0 (.Values.replicaCount)) | ternary 1 (sub .Values.replicaCount 1) }}
@@ -104,6 +116,18 @@ spec:
securityContext:
runAsUser: 0
fsGroup: 0
+ {{- if .Values.affinity.podAntiAffinity.enabled }}
+ affinity:
+ podAntiAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ - labelSelector:
+ matchExpressions:
+ - key: strimzi.io/name
+ operator: In
+ values:
+ - {{ include "common.fullname" . }}-zookeeper
+ topologyKey: "kubernetes.io/hostname"
+ {{- end }}
replicas: {{ .Values.replicaCount }}
config:
ssl.hostnameVerification: false
diff --git a/kubernetes/strimzi/values.yaml b/kubernetes/strimzi/values.yaml
index bb22de7ebd..a9eed5d8b9 100644
--- a/kubernetes/strimzi/values.yaml
+++ b/kubernetes/strimzi/values.yaml
@@ -29,6 +29,9 @@ global:
# Application configuration defaults.
#################################################################
replicaCount: 3
+affinity:
+ podAntiAffinity:
+ enabled: true
config:
kafkaVersion: 3.4.0
authType: simple