Skip to content

Commit

Permalink
Merge pull request #121 from Yolean/test-producer-acks-config
Browse files Browse the repository at this point in the history
Use min.insync.replicas for standard tests
  • Loading branch information
solsson authored Nov 28, 2018
2 parents 198666d + 5fa1078 commit 0d3e214
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
21 changes: 14 additions & 7 deletions kafka/test/kafkacat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
spec:
containers:
- name: topic-create
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
command:
- ./bin/kafka-topics.sh
- --zookeeper
Expand All @@ -82,9 +82,13 @@ spec:
- --topic
- test-kafkacat
- --partitions
- "1"
- --replication-factor
- "3"
- --replication-factor
- "2"
resources:
limits:
cpu: 200m
memory: 100Mi
restartPolicy: Never
---
apiVersion: apps/v1beta2
Expand All @@ -107,26 +111,29 @@ spec:
spec:
containers:
- name: producer
image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
env:
- name: BOOTSTRAP
value: bootstrap.kafka:9092
- name: ACKS
# -1 means use brokers' min.insync.replicas
value: "-1"
command:
- /bin/bash
- -cex
- >
echo "--- start $HOSTNAME $(date --iso-8601='ns' -u) ---" >> /shared/produce.tmp
;
tail -f /shared/produce.tmp |
kafkacat -P -b $BOOTSTRAP -t test-kafkacat -v -T -d broker -K ':'
kafkacat -P -b $BOOTSTRAP -t test-kafkacat -v -T -d broker -K ':' -X request.required.acks=$ACKS
;
volumeMounts:
- name: config
mountPath: /test
- name: shared
mountPath: /shared
- name: consumer
image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
env:
- name: BOOTSTRAP
value: bootstrap.kafka:9092
Expand All @@ -145,7 +152,7 @@ spec:
- name: shared
mountPath: /shared
- name: testcase
image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
env:
- name: BOOTSTRAP
value: bootstrap.kafka:9092
Expand Down
35 changes: 28 additions & 7 deletions kafka/test/produce-consume.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
spec:
containers:
- name: topic-create
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
command:
- ./bin/kafka-topics.sh
- --zookeeper
Expand All @@ -65,9 +65,13 @@ spec:
- --topic
- test-produce-consume
- --partitions
- "1"
- --replication-factor
- "3"
- --replication-factor
- "2"
resources:
limits:
cpu: 200m
memory: 100Mi
restartPolicy: Never
---
apiVersion: apps/v1beta2
Expand Down Expand Up @@ -95,26 +99,35 @@ spec:
spec:
containers:
- name: producer
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
env:
- name: BOOTSTRAP
value: bootstrap.kafka:9092
- name: ACKS
# -1 means use brokers' min.insync.replicas
value: "-1"
command:
- /bin/bash
- -cex
- >
echo "--- start $HOSTNAME $(date --iso-8601='ns' -u) ---" >> /shared/produce.tmp
;
./bin/kafka-topics.sh --zookeeper zookeeper.kafka:2181 --describe --topic test-produce-consume
;
tail -f /shared/produce.tmp |
./bin/kafka-console-producer.sh --broker-list $BOOTSTRAP --topic test-produce-consume
./bin/kafka-console-producer.sh --broker-list $BOOTSTRAP --topic test-produce-consume --producer-property "acks=$ACKS"
;
resources:
limits:
cpu: 100m
memory: 120Mi
volumeMounts:
- name: config
mountPath: /test
- name: shared
mountPath: /shared
- name: consumer
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
env:
- name: BOOTSTRAP
value: bootstrap.kafka:9092
Expand All @@ -125,13 +138,17 @@ spec:
./bin/kafka-console-consumer.sh --bootstrap-server $BOOTSTRAP --topic test-produce-consume |
tee /shared/consumed.tmp
;
resources:
limits:
cpu: 100m
memory: 120Mi
volumeMounts:
- name: config
mountPath: /test
- name: shared
mountPath: /shared
- name: testcase
image: solsson/kafkacat@sha256:ebebf47061300b14a4b4c2e1e4303ab29f65e4b95d34af1b14bb8f7ec6da7cef
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
env:
- name: BOOTSTRAP
value: bootstrap.kafka:9092
Expand All @@ -153,6 +170,10 @@ spec:
- /bin/bash
- -e
- /test/quit-on-nonzero-exit.sh
resources:
limits:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: config
mountPath: /test
Expand Down

0 comments on commit 0d3e214

Please sign in to comment.