From 1ad910e84c0095d3d8fb3c7acc08bc663bb03eeb Mon Sep 17 00:00:00 2001 From: ycz008 Date: Wed, 26 Jul 2023 22:08:29 +0800 Subject: [PATCH] add kafka release --- dev-upgrade/elastic/kibana.yaml | 68 -------------- .../elastic/{stroage.yaml => storage.yaml} | 1 + .../kafka/{kafka.yaml => kafka-dev.yaml} | 0 dev-upgrade/kafka/kafka-release.yaml | 92 +++++++++++++++++++ 4 files changed, 93 insertions(+), 68 deletions(-) delete mode 100644 dev-upgrade/elastic/kibana.yaml rename dev-upgrade/elastic/{stroage.yaml => storage.yaml} (89%) rename dev-upgrade/kafka/{kafka.yaml => kafka-dev.yaml} (100%) create mode 100644 dev-upgrade/kafka/kafka-release.yaml diff --git a/dev-upgrade/elastic/kibana.yaml b/dev-upgrade/elastic/kibana.yaml deleted file mode 100644 index c074e53..0000000 --- a/dev-upgrade/elastic/kibana.yaml +++ /dev/null @@ -1,68 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: kibana-config -data: - kibana.yml: |- - server.name: kibana - server.host: 0.0.0.0 - elasticsearch.hosts: [ "http://elastic:9200" ] - monitoring.ui.container.elasticsearch.enabled: true - elasticsearch.username: kibana-admin - elasticsearch.password: admin123 ---- -apiVersion: v1 -kind: Service -metadata: - name: kibana - labels: - app: kibana -spec: - ports: - - port: 5601 - targetPort: 5601 - nodePort: 30020 - selector: - app: kibana - type: NodePort ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kibana - labels: - app: kibana -spec: - replicas: 1 - selector: - matchLabels: - app: kibana - template: - metadata: - labels: - app: kibana - spec: - containers: - - name: kibana - image: docker.elastic.co/kibana/kibana:8.8.0 - volumeMounts: - - name: config - mountPath: /usr/share/kibana/config/kibana.yml - subPath: kibana.yml - readOnly: true - resources: - requests: - cpu: 100m - memory: 128Mi - limits: - cpu: 1 - memory: 1Gi - ports: - - containerPort: 5601 - volumes: - - name: config - configMap: - name: kibana-config - items: - - key: kibana.yml - path: kibana.yml \ No newline at end of file diff --git a/dev-upgrade/elastic/stroage.yaml b/dev-upgrade/elastic/storage.yaml similarity index 89% rename from dev-upgrade/elastic/stroage.yaml rename to dev-upgrade/elastic/storage.yaml index 4e14951..b26a211 100644 --- a/dev-upgrade/elastic/stroage.yaml +++ b/dev-upgrade/elastic/storage.yaml @@ -4,5 +4,6 @@ kind: StorageClass metadata: name: local-elastic provisioner: openebs.io/local +reclaimPolicy: Retain allowVolumeExpansion: true volumeBindingMode: WaitForFirstConsumer diff --git a/dev-upgrade/kafka/kafka.yaml b/dev-upgrade/kafka/kafka-dev.yaml similarity index 100% rename from dev-upgrade/kafka/kafka.yaml rename to dev-upgrade/kafka/kafka-dev.yaml diff --git a/dev-upgrade/kafka/kafka-release.yaml b/dev-upgrade/kafka/kafka-release.yaml new file mode 100644 index 0000000..1edff8e --- /dev/null +++ b/dev-upgrade/kafka/kafka-release.yaml @@ -0,0 +1,92 @@ +--- +apiVersion: platform.confluent.io/v1beta1 +kind: Zookeeper +metadata: + name: zookeeper +spec: + replicas: 3 + configOverrides: + jvm: + - "-Xmx128m" + podTemplate: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - es-release + 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: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + 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 + dataVolumeCapacity: 20Gi + storageClass: + name: local-kafka + metricReporter: + enabled: true + # dependencies: + # 多个kakfa集群复用zk + # zookeeper: + # endpoint: zookeeper.common.svc.cluster.local:2181 +--- +apiVersion: platform.confluent.io/v1beta1 +kind: SchemaRegistry +metadata: + name: schemaregistry +spec: + replicas: 3 + configOverrides: + jvm: + - "-Xmx128m" + podTemplate: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + 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