From 2cc6164bbfd944b14297241d9b9101aeb1331203 Mon Sep 17 00:00:00 2001 From: ycz008 Date: Wed, 12 Jul 2023 11:22:45 +0800 Subject: [PATCH] update kafka --- dev-upgrade/kafka/akhq.yaml | 108 +++++++++++++++++++++++++++++++++ dev-upgrade/kafka/kafka.yaml | 94 ++++++++++++++++++++++++++++ dev-upgrade/kafka/storage.yaml | 9 +++ 3 files changed, 211 insertions(+) create mode 100644 dev-upgrade/kafka/akhq.yaml create mode 100644 dev-upgrade/kafka/kafka.yaml create mode 100644 dev-upgrade/kafka/storage.yaml diff --git a/dev-upgrade/kafka/akhq.yaml b/dev-upgrade/kafka/akhq.yaml new file mode 100644 index 0000000..274dc61 --- /dev/null +++ b/dev-upgrade/kafka/akhq.yaml @@ -0,0 +1,108 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: akhq-config +data: + application.yml: | + akhq: + connections: + kafka-cluster: + properties: + bootstrap.servers: "kafka-0-internal:9092,kafka-1-internal:9092,kafka-2-internal:9092" + schema-registry: + url: "http://schemaregistry-0-internal:8081,http://schemaregistry-1-internal:8081,http://schemaregistry-2-internal:8081" + type: "confluent" + micronaut: + security: + enabled: true + token: + jwt: + signatures: + secret: + generator: + secret: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjpbeyJ0b29sdHQiOiJodHRwczovL3Rvb2x0dC5jb20ifV0sImlhdCI6MTY4NTY4OTU1MiwiZXhwIjoyNTM3NjI1NTk5LCJhdWQiOiIiLCJpc3MiOiJzbWFsbGtvdWRhaSIsInN1YiI6IiJ9.mKw9nKRhQimdaNtMWLHT9TqIn2-iIcZR4txgy8z07xQ + + akhq.security: + basic-auth: + - username: admin + password: "$2a$10$ARWW4TWyaAywZ0vS4ua62OS8s.qm3cVHGmApWx8vALSMzUVS.q.Se" + passwordHash: BCRYPT + groups: + - admin + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: akhq +spec: + replicas: 1 + selector: + matchLabels: + app: akhq + template: + metadata: + labels: + app: akhq + spec: + containers: + - name: akhq + image: tchiotludo/akhq + env: + - name: MICRONAUT_CONFIG_FILES + value: /app/application.yml + ports: + - name: http + containerPort: 8080 + protocol: TCP + - name: management + containerPort: 28081 + protocol: TCP + volumeMounts: + - name: config + mountPath: /app/application.yml + subPath: application.yml + livenessProbe: + httpGet: + path: /health + port: management + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health + port: management + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + resources: {} + volumes: + - name: config + configMap: + name: akhq-config +--- +apiVersion: v1 +kind: Service +metadata: + name: akhq +spec: + type: NodePort + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: http + nodePort: 30022 + - name: management + protocol: TCP + port: 28081 + targetPort: management + nodePort: 30023 + selector: + app: akhq \ No newline at end of file diff --git a/dev-upgrade/kafka/kafka.yaml b/dev-upgrade/kafka/kafka.yaml new file mode 100644 index 0000000..5af5984 --- /dev/null +++ b/dev-upgrade/kafka/kafka.yaml @@ -0,0 +1,94 @@ +--- +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 +spec: + replicas: 3 + configOverrides: + server: + - auto.create.topics.enable=true + - default.replication.factor=3 + jvm: + - "-Xmx512m" + podTemplate: + resources: + requests: + memory: "256Mi" + cpu: "100m" + limits: + memory: "4G" + cpu: "1" + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - kafka + topologyKey: kubernetes.io/hostname + image: + application: confluentinc/cp-server:7.4.0 + init: confluentinc/confluent-init-container:2.6.0 + dataVolumeCapacity: 20Gi + storageClass: + name: local-kafka + metricReporter: + enabled: true + dependencies: + zookeeper: + endpoint: zookeeper.basic.svc.cluster.local:2181 +--- +apiVersion: platform.confluent.io/v1beta1 +kind: SchemaRegistry +metadata: + name: schemaregistry +spec: + replicas: 3 + configOverrides: + jvm: + - "-Xmx128m" + podTemplate: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - schemaregistry + topologyKey: kubernetes.io/hostname + 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 new file mode 100644 index 0000000..84652fb --- /dev/null +++ b/dev-upgrade/kafka/storage.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: local-kafka +provisioner: openebs.io/local +reclaimPolicy: Retain +allowVolumeExpansion: true +volumeBindingMode: WaitForFirstConsumer \ No newline at end of file