Deploying as kubernetes component
MacherelR opened this issue · comments
Rémy Macherel commented
Hello,
I was wondering if you tried deploying it as kubernetes pod ?
I was trying it and encountered some problems, I had to define an "entrypoint" script which looks like this :
# shellcheck disable=SC1083
# Wait until the REST server is available
while [ "$(curl -s -o /dev/null -w %{http_code} http://localhost:8083/connectors)" -ne 200 ]; do
sleep 5
done
# Configure the connector
curl -i -X PUT -H "Content-Type:application/json"
http://localhost:8083/connectors/lysr-source-connector/config \
-d "{
\"connector.class\": \"ai.lysr.mqttconnector.LysrSourceMqttConnector\",
\"tasks.max\": \"1\",
\"topics.regex\": \"^[0-9]*$\",
\"key.converter\": \"org.apache.kafka.connect.storage.StringConverter\",
\"value.converter\": \"org.apache.kafka.connect.storage.StringConverter\",
\"mqtt.broker\": \"$MQTT_BROKER_URL\",
\"mqtt.clientID\": \"$MQTT_CLIENT_ID\",
\"mqtt.topic\": \"$MQTT_TOPIC\",
\"mqtt.userName\": \"$MQTT_USERNAME\",
\"mqtt.password\": \"$MQTT_PASSWORD\"
}"
To configure the connector and the dockerfile is the following:
FROM confluentinc/cp-kafka-connect-base:7.0.1
ENV CONNECT_PLUGIN_PATH=/app
WORKDIR /app
COPY build/app .
But I get the error :
===> Configuring ...
CONNECT_KEY_CONVERTER is required.
Command [/usr/local/bin/dub ensure CONNECT_KEY_CONVERTER] FAILED !
Any idea ?