aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStaffan Olsson <staffan@repos.se>2018-02-02 14:11:38 +0100
committerStaffan Olsson <staffan@repos.se>2018-02-02 14:11:38 +0100
commit470c1cecfc29f0e27f1c865341e77fed027b8bdb (patch)
treecbdea4e984ff99e43f5f8deed37c68e64c38de2f
parente6a7aec8bd4db6cb75617e05dd451f77f9a0cd54 (diff)
downloadkubernetes-kafka-470c1cecfc29f0e27f1c865341e77fed027b8bdb.tar.gz
kubernetes-kafka-470c1cecfc29f0e27f1c865341e77fed027b8bdb.tar.bz2
kubernetes-kafka-470c1cecfc29f0e27f1c865341e77fed027b8bdb.zip
Starts from the reassign-partitions job
-rw-r--r--maintenance/increase-replication-factor.yml51
1 files changed, 51 insertions, 0 deletions
diff --git a/maintenance/increase-replication-factor.yml b/maintenance/increase-replication-factor.yml
new file mode 100644
index 0000000..e9e184e
--- /dev/null
+++ b/maintenance/increase-replication-factor.yml
@@ -0,0 +1,51 @@
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: reassign-partitions
+ namespace: kafka
+spec:
+ template:
+ metadata:
+ name: reassign-partitions
+ spec:
+ containers:
+ - name: kafka
+ image: solsson/kafka:1.0.0@sha256:17fdf1637426f45c93c65826670542e36b9f3394ede1cb61885c6a4befa8f72d
+ env:
+ - name: ZOOKEEPER
+ value: zookeeper.kafka:2181
+ # the following must be edited per job
+ - name: TOPICS
+ value: test-produce-consume,test-kafkacat
+ - name: BROKERS
+ value: 0,2
+ command:
+ - /bin/bash
+ - -ce
+ - >
+ echo '{"topics":[' > /tmp/reassign-topics.json;
+ echo -n ' {"topic":"' >> /tmp/reassign-topics.json;
+ echo -n $TOPICS | sed 's/,/"},\n {"topic":"/g' >> /tmp/reassign-topics.json;
+ echo '"}' >> /tmp/reassign-topics.json;
+ echo ']}' >> /tmp/reassign-topics.json;
+
+ echo "# reassign-topics.json";
+ cat /tmp/reassign-topics.json;
+
+ ./bin/kafka-reassign-partitions.sh
+ --zookeeper=$ZOOKEEPER
+ --generate
+ --topics-to-move-json-file=/tmp/reassign-topics.json
+ --broker-list=$BROKERS > /tmp/generated.txt;
+
+ tail -n 1 /tmp/generated.txt > /tmp/proposed-reassignment.json;
+
+ echo "# proposed-reassignment.json";
+ cat /tmp/proposed-reassignment.json;
+
+ ./bin/kafka-reassign-partitions.sh
+ --zookeeper=$ZOOKEEPER
+ --execute
+ --reassignment-json-file=/tmp/proposed-reassignment.json;
+ restartPolicy: Never
+ backoffLimit: 3