diff --git a/helm/templates/kafka/kafka-cluster.yaml b/helm/templates/kafka/kafka-cluster.yaml index ee2bd0f1c529f98a9d838a704c6f277e9106f439..874826458b7d1107d0875ff92bbf7343173e4031 100644 --- a/helm/templates/kafka/kafka-cluster.yaml +++ b/helm/templates/kafka/kafka-cluster.yaml @@ -5,6 +5,9 @@ metadata: name: {{ template "theodolite.fullname" . }}-kafka spec: kafka: + resources: + requests: + cpu: "2000m" jmxOptions: {} {{- with .Values.strimzi.kafka.listeners }} listeners: @@ -30,9 +33,21 @@ spec: configMapKeyRef: name: {{ template "theodolite.fullname" . }}-kafka-metrics key: kafka-metrics-config.yml - {{- with .Values.strimzi.kafka.template}} template: - {{- toYaml . | nindent 6 }} + pod: + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway + labelSelector: + matchLabels: + strimzi.io/name: theodolite-kafka-kafka + {{- with .Values.strimzi.kafka.nodeSelectorTerms}} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + {{- toYaml . | nindent 16 }} {{- end}} {{- with .Values.strimzi.kafka.resources}} resources: @@ -47,9 +62,14 @@ spec: {{- end }} storage: type: ephemeral - {{- with .Values.strimzi.kafka.template}} + {{- with .Values.strimzi.zookeeper.nodeSelectorTerms}} template: - {{- toYaml . | nindent 6 }} + pod: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + {{- toYaml . | nindent 16 }} {{- end}} kafkaExporter: {}