<p>I'm using a SimpleProducer in the python kafka-library.
This script has worked flawlessly previously with other more hard-configured kafka-setups I've tried.</p>

<pre><code>kafka = KafkaClient(u'[masterNodeIp]:[servicePort]')
producer = SimpleProducer(kafka)
#make a simple message, while true run
producer.send_messages(b'oneMoreTopic', sentence)
</code></pre>

<p>After running this script once, I get this response in the python-console.</p>

<pre><code>kafka.common.LeaderNotAvailableError: TopicMetadata(topic='oneMoreTopic', error=5, partitions=[])
</code></pre>

<p>I can then go into my Node on my zookeeper.log and see:</p>

<pre><code>2015-09-14 12:16:32,276 - INFO  [ProcessThread(sid:3  cport:-1)::PrepRequestProcessor@627] - Got user-level KeeperException when processing sessionid:0x34fcb982d030000 type:setData cxid:0x71 zxid:0x1000000d8 txntype:-1 reqpath:n/a Error Path:/config/topics/oneMoreTopic Error:KeeperErrorCode = NoNode for /config/topics/oneMoreTopic
2015-09-14 12:16:32,278 - INFO  [ProcessThread(sid:3 cport:-1)::PrepRequestProcessor@627] - Got user-level KeeperException when processing sessionid:0x34fcb982d030000 type:create cxid:0x72 zxid:0x1000000d9 txntype:-1 reqpath:n/a Error Path:/config/topics Error:KeeperErrorCode = NodeExists for /config/topics
2015-09-14 12:16:32,302 - INFO  [ProcessThread(sid:3 cport:-1)::PrepRequestProcessor@627] - Got user-level KeeperException when processing sessionid:0x34fcb982d030000 type:create cxid:0x7b zxid:0x1000000dc txntype:-1 reqpath:n/a Error Path:/brokers/topics/oneMoreTopic/partitions/0 Error:KeeperErrorCode = NoNode for /brokers/topics/oneMoreTopic/partitions/0
2015-09-14 12:16:32,304 - INFO  [ProcessThread(sid:3 cport:-1)::PrepRequestProcessor@627] - Got user-level KeeperException when processing sessionid:0x34fcb982d030000 type:create cxid:0x7c zxid:0x1000000dd txntype:-1 reqpath:n/a Error Path:/brokers/topics/oneMoreTopic/partitions Error:KeeperErrorCode = NoNode for /brokers/topics/oneMoreTopic/partitions
</code></pre>

<p>This seems to just be the Zookeeper creating a new Znode for the topic since it is not there from before. And the Kafka server.log prints:</p>

<pre><code>[2015-09-14 12:16:32,282] INFO Topic creation {"version":1,"partitions":{"0":[10200119]}} (kafka.admin.AdminUtils$)
[2015-09-14 12:16:32,287] INFO [KafkaApi-10200219] Auto creation of topic oneMoreTopic with 1 partitions and replication factor 1 is successful! (kafka.server.KafkaApis)
[2015-09-14 12:16:51,579] INFO Closing socket connection to /10.240.1.94. (kafka.network.Processor)
</code></pre>

<p>However, my message is never posted to the topic and the next time i run the python-script i always get:</p>

<pre><code>kafka.common.FailedPayloadsError
</code></pre>

<p>In the cases where i made it work, the advertised.host.name was always the external IP of the node, but I can't seem to get that working through Kubernetes. Would it be possible to make the external IP callable from the container parhaps?</p>

<p>my kafka/config/server.properties looks something like this for all brokers:</p>

<pre><code>broker.id=10200121
host.name=kafka-f8p06
advertised.host.name=kafka-f8p06
++
</code></pre>

<pre><code>broker.id=10200121
host.name=kafka-f8p06  &lt;----- use IP here
advertised.host.name=kafka-f8p06  &lt;---- use IP here
</code></pre>

<p>I think you should have IPs for <code>host.name</code> and <code>advertised.host.name</code> as K8s does not resolve Pods by hostname but it does by IP.</p>

<p>Your kafka nodes probably can't talk to each other that way and can't find the leader.</p>
