diff options
author | Staffan Olsson <staffan@repos.se> | 2016-09-05 14:13:17 +0200 |
---|---|---|
committer | Staffan Olsson <staffan@repos.se> | 2016-09-05 14:19:00 +0200 |
commit | 31d6c90bc924958eb7b9faaf4019cc3a48645413 (patch) | |
tree | f9eecd61a7311bc543f068d3da7390db325df4e9 | |
parent | 8069d5d2e109d5e956dc457e50e6d11edbc62d98 (diff) | |
download | kubernetes-kafka-31d6c90bc924958eb7b9faaf4019cc3a48645413.tar.gz kubernetes-kafka-31d6c90bc924958eb7b9faaf4019cc3a48645413.tar.bz2 kubernetes-kafka-31d6c90bc924958eb7b9faaf4019cc3a48645413.zip |
Towards automated testing
-rw-r--r-- | README.md | 25 | ||||
-rw-r--r-- | test/10topic-create-test1.yml | 25 |
2 files changed, 49 insertions, 1 deletions
@@ -29,12 +29,35 @@ This module contains a copy of `pets/zookeeper/` from https://github.com/kuberne See the `./zookeeper` folder and follow the README there. +An additional service has been added here, create using: +``` +kubectl create -f ./zookeeper/service.yml +``` + ## Start Kafka ``` kubectl create -f ./ ``` +You might want to verify in logs that Kafka found its own DNS name(s) correctly. Look for records like: +``` +kubectl logs kafka-0 | grep "Registered broker" +# INFO Registered broker 0 at path /brokers/ids/0 with addresses: PLAINTEXT -> EndPoint(kafka-0.broker.kafka.svc.cluster.local,9092,PLAINTEXT) +``` + ## Testing manually -See `./test/test.sh`. +There's a Kafka pod that doesn't start the server, so you can invoke the various shell scripts. +``` +kubectl create -f test/99testclient.yml +``` + +See `./test/test.sh` for some sample commands. + +## Automated test, while going chaosmonkey on the cluster + +This is WIP, but topic creation has been automated. Note that as a [Job](http://kubernetes.io/docs/user-guide/jobs/), it will restart if the command fails, including if the topic exists :( +``` +kubectl create -f test/10topic-create-test1.yml +``` diff --git a/test/10topic-create-test1.yml b/test/10topic-create-test1.yml new file mode 100644 index 0000000..fdb805e --- /dev/null +++ b/test/10topic-create-test1.yml @@ -0,0 +1,25 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: topic-create-test1 + namespace: kafka +spec: + template: + metadata: + name: topic-create-test1 + spec: + containers: + - name: kafka + image: solsson/kafka:0.10.0.1 + command: + - ./bin/kafka-topics.sh + - --zookeeper + - zookeeper:2181 + - --create + - --topic + - test1 + - --partitions + - "1" + - --replication-factor + - "1" + restartPolicy: Never |