I am trying to create a kafka connector after connect-distributed command is executed. I wrote a entrypoint.sh script and used it with CMD. I have docker file like this:
FROM confluentinc/cp-kafka
RUN mkdir /plugins
RUN mkdir /config
COPY kafka-connect-couchbase-*.jar /plugins/
COPY config /config/
RUN chmod +x /config/stage/entrypoint.sh
ENV EXPOSED_PORT 8083
CMD /config/stage/entrypoint.sh
I have entrypoint script file as:
connect-distributed config/"${DEPLOY_ENV}"/connect-distributed.properties
curl -X POST -H "Content-Type: application/json" -d @config.json http://localhost:8083/connectors
deploy_env is irrelevant, it is coming from jenkins. config file and distributed.properties is irrelevant too, and it is correct, I tried it manually.
Kafka connect starts without a problem, however curl command for creating connector has no effect.
In short, I want to create a connector after connect-distributed is started without executing any rest request outside of container. How do I achieve that?