From 9b1f9f962a44fe721d4651bb41ad4245ec2b57ea Mon Sep 17 00:00:00 2001 From: ycz008 Date: Wed, 12 Jul 2023 12:51:30 +0800 Subject: [PATCH] update kafka --- dev-upgrade/kafka/kafka.yaml | 76 ++++++++++++++------------------ dev-upgrade/kafka/storage.yaml | 10 +++++ dev-upgrade/kafka/zookeeper.yaml | 36 +++++++++++++++ 3 files changed, 78 insertions(+), 44 deletions(-) create mode 100644 dev-upgrade/kafka/zookeeper.yaml diff --git a/dev-upgrade/kafka/kafka.yaml b/dev-upgrade/kafka/kafka.yaml index 5af5984..41e4b7c 100644 --- a/dev-upgrade/kafka/kafka.yaml +++ b/dev-upgrade/kafka/kafka.yaml @@ -1,33 +1,5 @@ --- apiVersion: platform.confluent.io/v1beta1 -kind: Zookeeper -metadata: - name: zookeeper -spec: - replicas: 3 - configOverrides: - jvm: - - "-Xmx128m" - podTemplate: - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - zookeeper - topologyKey: kubernetes.io/hostname - image: - application: confluentinc/cp-zookeeper:7.4.0 - init: confluentinc/confluent-init-container:2.6.0 - dataVolumeCapacity: 10Gi - logVolumeCapacity: 10Gi - storageClass: - name: local-kafka ---- -apiVersion: platform.confluent.io/v1beta1 kind: Kafka metadata: name: kafka @@ -48,15 +20,23 @@ spec: memory: "4G" cpu: "1" affinity: - podAntiAffinity: + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app + # operator: In + # values: + # - kafka + # topologyKey: kubernetes.io/hostname + nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - kafka - topologyKey: kubernetes.io/hostname + nodeSelectorTerms: + - matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - trainer image: application: confluentinc/cp-server:7.4.0 init: confluentinc/confluent-init-container:2.6.0 @@ -80,15 +60,23 @@ spec: - "-Xmx128m" podTemplate: affinity: - podAntiAffinity: + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app + # operator: In + # values: + # - schemaregistry + # topologyKey: kubernetes.io/hostname + nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - schemaregistry - topologyKey: kubernetes.io/hostname + nodeSelectorTerms: + - matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - trainer image: application: confluentinc/cp-schema-registry:7.4.0 init: confluentinc/confluent-init-container:2.6.0 diff --git a/dev-upgrade/kafka/storage.yaml b/dev-upgrade/kafka/storage.yaml index 84652fb..1641079 100644 --- a/dev-upgrade/kafka/storage.yaml +++ b/dev-upgrade/kafka/storage.yaml @@ -1,3 +1,13 @@ +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: local-zookeeper +provisioner: openebs.io/local +reclaimPolicy: Retain +allowVolumeExpansion: true +volumeBindingMode: WaitForFirstConsumer + --- apiVersion: storage.k8s.io/v1 kind: StorageClass diff --git a/dev-upgrade/kafka/zookeeper.yaml b/dev-upgrade/kafka/zookeeper.yaml new file mode 100644 index 0000000..137e11e --- /dev/null +++ b/dev-upgrade/kafka/zookeeper.yaml @@ -0,0 +1,36 @@ +--- +apiVersion: platform.confluent.io/v1beta1 +kind: Zookeeper +metadata: + name: zookeeper +spec: + replicas: 3 + configOverrides: + jvm: + - "-Xmx128m" + podTemplate: + affinity: + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app + # operator: In + # values: + # - zookeeper + # topologyKey: kubernetes.io/hostname + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - trainer + image: + application: confluentinc/cp-zookeeper:7.4.0 + init: confluentinc/confluent-init-container:2.6.0 + dataVolumeCapacity: 10Gi + logVolumeCapacity: 10Gi + storageClass: + name: local-zookeeper \ No newline at end of file