Skip to content

Commit 0d3e214

Browse files
authored
Merge pull request #121 from Yolean/test-producer-acks-config
Use min.insync.replicas for standard tests
2 parents 198666d + 5fa1078 commit 0d3e214

File tree

2 files changed

+42
-14
lines changed

2 files changed

+42
-14
lines changed

kafka/test/kafkacat.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ spec:
7272
spec:
7373
containers:
7474
- name: topic-create
75-
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
75+
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
7676
command:
7777
- ./bin/kafka-topics.sh
7878
- --zookeeper
@@ -82,9 +82,13 @@ spec:
8282
- --topic
8383
- test-kafkacat
8484
- --partitions
85-
- "1"
86-
- --replication-factor
8785
- "3"
86+
- --replication-factor
87+
- "2"
88+
resources:
89+
limits:
90+
cpu: 200m
91+
memory: 100Mi
8892
restartPolicy: Never
8993
---
9094
apiVersion: apps/v1beta2
@@ -107,26 +111,29 @@ spec:
107111
spec:
108112
containers:
109113
- name: producer
110-
image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9
114+
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
111115
env:
112116
- name: BOOTSTRAP
113117
value: bootstrap.kafka:9092
118+
- name: ACKS
119+
# -1 means use brokers' min.insync.replicas
120+
value: "-1"
114121
command:
115122
- /bin/bash
116123
- -cex
117124
- >
118125
echo "--- start $HOSTNAME $(date --iso-8601='ns' -u) ---" >> /shared/produce.tmp
119126
;
120127
tail -f /shared/produce.tmp |
121-
kafkacat -P -b $BOOTSTRAP -t test-kafkacat -v -T -d broker -K ':'
128+
kafkacat -P -b $BOOTSTRAP -t test-kafkacat -v -T -d broker -K ':' -X request.required.acks=$ACKS
122129
;
123130
volumeMounts:
124131
- name: config
125132
mountPath: /test
126133
- name: shared
127134
mountPath: /shared
128135
- name: consumer
129-
image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9
136+
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
130137
env:
131138
- name: BOOTSTRAP
132139
value: bootstrap.kafka:9092
@@ -145,7 +152,7 @@ spec:
145152
- name: shared
146153
mountPath: /shared
147154
- name: testcase
148-
image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9
155+
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
149156
env:
150157
- name: BOOTSTRAP
151158
value: bootstrap.kafka:9092

kafka/test/produce-consume.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spec:
5555
spec:
5656
containers:
5757
- name: topic-create
58-
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
58+
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
5959
command:
6060
- ./bin/kafka-topics.sh
6161
- --zookeeper
@@ -65,9 +65,13 @@ spec:
6565
- --topic
6666
- test-produce-consume
6767
- --partitions
68-
- "1"
69-
- --replication-factor
7068
- "3"
69+
- --replication-factor
70+
- "2"
71+
resources:
72+
limits:
73+
cpu: 200m
74+
memory: 100Mi
7175
restartPolicy: Never
7276
---
7377
apiVersion: apps/v1beta2
@@ -95,26 +99,35 @@ spec:
9599
spec:
96100
containers:
97101
- name: producer
98-
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
102+
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
99103
env:
100104
- name: BOOTSTRAP
101105
value: bootstrap.kafka:9092
106+
- name: ACKS
107+
# -1 means use brokers' min.insync.replicas
108+
value: "-1"
102109
command:
103110
- /bin/bash
104111
- -cex
105112
- >
106113
echo "--- start $HOSTNAME $(date --iso-8601='ns' -u) ---" >> /shared/produce.tmp
107114
;
115+
./bin/kafka-topics.sh --zookeeper zookeeper.kafka:2181 --describe --topic test-produce-consume
116+
;
108117
tail -f /shared/produce.tmp |
109-
./bin/kafka-console-producer.sh --broker-list $BOOTSTRAP --topic test-produce-consume
118+
./bin/kafka-console-producer.sh --broker-list $BOOTSTRAP --topic test-produce-consume --producer-property "acks=$ACKS"
110119
;
120+
resources:
121+
limits:
122+
cpu: 100m
123+
memory: 120Mi
111124
volumeMounts:
112125
- name: config
113126
mountPath: /test
114127
- name: shared
115128
mountPath: /shared
116129
- name: consumer
117-
image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789
130+
image: solsson/kafka:2.1.0@sha256:ac3f06d87d45c7be727863f31e79fbfdcb9c610b51ba9cf03c75a95d602f15e1
118131
env:
119132
- name: BOOTSTRAP
120133
value: bootstrap.kafka:9092
@@ -125,13 +138,17 @@ spec:
125138
./bin/kafka-console-consumer.sh --bootstrap-server $BOOTSTRAP --topic test-produce-consume |
126139
tee /shared/consumed.tmp
127140
;
141+
resources:
142+
limits:
143+
cpu: 100m
144+
memory: 120Mi
128145
volumeMounts:
129146
- name: config
130147
mountPath: /test
131148
- name: shared
132149
mountPath: /shared
133150
- name: testcase
134-
image: solsson/kafkacat@sha256:ebebf47061300b14a4b4c2e1e4303ab29f65e4b95d34af1b14bb8f7ec6da7cef
151+
image: solsson/kafkacat@sha256:7a5961f861ddad53c25227511b9f36a5c13bc43296470b383be2f3e8e3a506f4
135152
env:
136153
- name: BOOTSTRAP
137154
value: bootstrap.kafka:9092
@@ -153,6 +170,10 @@ spec:
153170
- /bin/bash
154171
- -e
155172
- /test/quit-on-nonzero-exit.sh
173+
resources:
174+
limits:
175+
cpu: 100m
176+
memory: 100Mi
156177
volumeMounts:
157178
- name: config
158179
mountPath: /test

0 commit comments

Comments
 (0)