From c3d5a567a2973a3e53cf442c126b9553234c168b Mon Sep 17 00:00:00 2001 From: Matthieu Cauffiez Date: Tue, 12 Mar 2019 11:07:01 -0400 Subject: Add noteAffinity option to kafka/zookeeper enabled nodeaffinity for kafka. This will allow kafka/zookeeper to boot back on a node whree there is topic data Issue-ID: DMAAP-1089 Change-Id: Ic14d3201f03787f7abe8b83ae76d64a7c353ad87 Signed-off-by: Matthieu Cauffiez --- .../charts/message-router-kafka/templates/statefulset.yaml | 4 ++++ .../components/message-router/charts/message-router-kafka/values.yaml | 3 ++- .../charts/message-router-zookeeper/templates/statefulset.yaml | 4 ++++ .../message-router/charts/message-router-zookeeper/values.yaml | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/kubernetes/dmaap/components/message-router/charts/message-router-kafka/templates/statefulset.yaml b/kubernetes/dmaap/components/message-router/charts/message-router-kafka/templates/statefulset.yaml index 163bbc23b6..ae8364c616 100644 --- a/kubernetes/dmaap/components/message-router/charts/message-router-kafka/templates/statefulset.yaml +++ b/kubernetes/dmaap/components/message-router/charts/message-router-kafka/templates/statefulset.yaml @@ -44,6 +44,10 @@ spec: values: - {{ include "common.name" . }} topologyKey: "kubernetes.io/hostname" + {{- if .Values.nodeAffinity }} + nodeAffinity: + {{ toYaml .Values.nodeAffinity | indent 10 }} + {{- end }} initContainers: - name: {{ include "common.name" . }}-initcontainer image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}" diff --git a/kubernetes/dmaap/components/message-router/charts/message-router-kafka/values.yaml b/kubernetes/dmaap/components/message-router/charts/message-router-kafka/values.yaml index 6c121f9693..3ed1cb3d1f 100644 --- a/kubernetes/dmaap/components/message-router/charts/message-router-kafka/values.yaml +++ b/kubernetes/dmaap/components/message-router/charts/message-router-kafka/values.yaml @@ -47,9 +47,10 @@ replicaCount: 3 # defult partitions defaultpartitions: 3 - nodeSelector: {} +nodeAffinity: {} + affinity: {} # probe configuration parameters diff --git a/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml b/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml index 14f27949a7..d1ba2f5fd7 100644 --- a/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml +++ b/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/templates/statefulset.yaml @@ -48,6 +48,10 @@ spec: values: - {{ include "common.name" . }} topologyKey: "kubernetes.io/hostname" + {{- if .Values.nodeAffinity }} + nodeAffinity: + {{ toYaml .Values.nodeAffinity | indent 10 }} + {{- end }} initContainers: - name: {{ include "common.name" . }}-seed-topics-apikeys command: diff --git a/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/values.yaml b/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/values.yaml index 6eeafccb00..f658d2ccbf 100644 --- a/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/values.yaml +++ b/kubernetes/dmaap/components/message-router/charts/message-router-zookeeper/values.yaml @@ -49,6 +49,8 @@ replicaCount: 3 nodeSelector: {} +nodeAffinity: {} + affinity: {} # probe configuration parameters -- cgit 1.2.3-korg