Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds mirrormaker example for GKE clusters #175

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions mirrormaker/mirrormaker.yml
Original file line number Diff line number Diff line change
@@ -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"
32 changes: 32 additions & 0 deletions mirrormaker/source-endpoints.yml
Original file line number Diff line number Diff line change
@@ -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