forked from confluentinc/cp-helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to run custom scripts (Fix merge conflict with the latest…
… master) (confluentinc#392) Thank you @amit-k-yadav
- Loading branch information
1 parent
6d5fd5b
commit bc75a82
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## A script similar to this can be used to create connectors making sure the endpoints are ready | ||
|
||
echo "Waiting for Kafka Connect to start listening on kafka-connect " | ||
while :; do | ||
# Check if the connector endpoint is ready | ||
# If not check again | ||
curl_status=$(curl -s -o /dev/null -w %{http_code} http://localhost:{{ .Values.servicePort }}/connectors) | ||
echo -e $(date) "Kafka Connect listener HTTP state: " $curl_status " (waiting for 200)" | ||
if [ $curl_status -eq 200 ]; then | ||
break | ||
fi | ||
sleep 5 | ||
done | ||
|
||
echo "======> Creating connectors" | ||
# Send a simple POST request to create the connector | ||
curl -X POST \ | ||
-H "Content-Type: application/json" \ | ||
--data '{ | ||
"name": "sample-connector", | ||
"config": { | ||
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector", | ||
"tasks.max": 1, | ||
"connection.url": "jdbc:mysql://123.4.5.67:3306/test_db?user=root&password=pass", | ||
"mode": "incrementing", | ||
"incrementing.column.name": "id", | ||
"timestamp.column.name": "modified", | ||
"topic.prefix": "sample-connector-", | ||
"poll.interval.ms": 1000 | ||
} | ||
}' http://$CONNECT_REST_ADVERTISED_HOST_NAME:8083/connectors |