diff --git a/mirrormaker/mirrormaker.yml b/mirrormaker/mirrormaker.yml new file mode 100644 index 00000000..295df097 --- /dev/null +++ b/mirrormaker/mirrormaker.yml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mirror-a + namespace: kafka + labels: + app: mirrormaker +spec: + replicas: 1 + selector: + matchLabels: + app: mirrormaker + strategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + template: + metadata: + labels: + app: mirrormaker + spec: + containers: + - name: kafka + image: solsson/kafka:1.1@sha256:ba863ca7dc28563930584e37f93d57c2cbf3f46b1c1fa104fe8af7bcc0c31df4 + resources: + requests: + cpu: 0m + memory: 80Mi + limits: + cpu: 20m + memory: 200Mi + env: + - name: TARGET_BOOTSTRAP + value: bootstrap.kafka:9092 + - name: SOURCE_BOOTSTRAP + value: mirror-from.kafka:32400,mirror-from.kafka:32401,mirror-from.kafka:32402 + - name: WHITELIST + value: .*yolean.*operations.* + - name: GROUP_ID + value: mirror-to-4 + command: + - bash + - -cex + - > + echo "bootstrap.servers=$SOURCE_BOOTSTRAP" > ./config/consumer.properties; + echo "group.id=$GROUP_ID" >> ./config/consumer.properties; + echo "auto.offset.reset=none" >> ./config/consumer.properties; + echo "partition.assignment.strategy=org.apache.kafka.clients.consumer.RoundRobinAssignor" >> ./config/consumer.properties; + echo "bootstrap.servers=$TARGET_BOOTSTRAP" > ./config/producer.properties; + echo "log4j.logger.org.apache.kafka.clients.Metadata=DEBUG" >> ./config/tools-log4j.properties; + echo "log4j.logger.org.apache.kafka.clients.consumer.internals.AbstractCoordinator=INFO" >> ./config/tools-log4j.properties; + echo "log4j.logger.org.apache.kafka.clients.NetworkClient=INFO" >> ./config/tools-log4j.properties; + ./bin/kafka-mirror-maker.sh --consumer.config ./config/consumer.properties --producer.config ./config/producer.properties --whitelist "$WHITELIST" diff --git a/mirrormaker/source-endpoints.yml b/mirrormaker/source-endpoints.yml new file mode 100644 index 00000000..352acaee --- /dev/null +++ b/mirrormaker/source-endpoints.yml @@ -0,0 +1,32 @@ +kind: Service +apiVersion: v1 +metadata: + name: mirror-from + namespace: kafka +spec: + ports: + - name: outside-0 + port: 32400 + - name: outside-1 + port: 32401 + - name: outside-2 + port: 32402 +--- +kind: Endpoints +apiVersion: v1 +metadata: + name: mirror-from + namespace: kafka +subsets: +- addresses: + # source cluster: kubectl -n kafka get pods -l app=kafka -o yaml | grep outside + - ip: 10.132.0.13 + - ip: 10.132.0.9 + - ip: 10.132.0.10 + ports: + - name: outside-0 + port: 32400 + - name: outside-1 + port: 32401 + - name: outside-2 + port: 32402