Open styk-tv opened 6 years ago
Hi! A little more info on your configuration might be helpful. 32400 is the Plex port (according to google...) so I'm not sure how you're getting that either 😄
I'm launching your docker container from here https://hub.docker.com/r/hoppity/kafka-http-proxy/ in kubernetes in same namespace as kafka. I have only one kafka node and one zookeeper node but they are working fine and are resolvable. As to the configuration you can see above address is resolvable.
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-rest
namespace: kafka
spec:
replicas: 1
selector:
matchLabels:
app: kafka-rest
template:
metadata:
labels:
app: kafka-rest
spec:
containers:
- name: kafka-rest
image: hoppity/kafka-http-proxy
ports:
- containerPort: 8085
env:
- name: ZOOKEEPER_CONNECT
value: pzoo:2181
above config is in exports
declare -x ZOOKEEPER_CONNECT="pzoo:2181"
Hi @styk-tv. Sorry for the delay, but I managed to get a kubes cluster running kafka, zk and the proxy using minikube. Unfortunately, I couldn't reproduce your problem...
First I started minikube with some extra RAM using minikube start --memory 4096
.
Next I used the incubator/kafka helm chart to install kafka+zk with the following in mykafka.yaml -
replicas: 1
persistence:
enabled: false
zookeeper:
servers: 1
$ helm install incubator/kafka --name mykafka -f ./mykafka.yaml
Then I used the following yaml to create the deployment and a service -
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-rest
spec:
replicas: 1
selector:
matchLabels:
app: kafka-rest
template:
metadata:
labels:
app: kafka-rest
spec:
containers:
- name: kafka-rest
image: hoppity/kafka-http-proxy
ports:
- containerPort: 8085
env:
- name: ZOOKEEPER_CONNECT
value: mykafka-zookeeper:2181
---
apiVersion: v1
kind: Service
metadata:
name: kafka-rest
labels:
run: kafka-rest
spec:
type: NodePort
ports:
- port: 8085
targetPort: 8085
protocol: TCP
selector:
app: kafka-rest
This exposed the service on port 32400. Everything started up and worked as expected.
Finally I posted to a topic -
$ curl -X POST \
-H 'Content-Type: application/kafka.binary.v1+json' \
-d '{"records":[{"value":"1234"}]}' \
http://192.168.99.101:32400/topics/test
Which returned the response {"offsets":[{"partition":"0","offset":0}]}
Is there any more information your can give around how you built your cluster or your kafka/zk...?
Startup fails with below error. Not sure where that address/port comes from. Zoo and kafka is up however no topics (maybe that has something to do with that). I'm attaching exception and at the bottom connectivity verification from rest pod.
Any suggestions would be cool.
Connectivity is there