Skip to content

[WIP] prelim set-up of resources to test kafka-connect source/sink demo #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addon-cp/rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
env:
- name: KAFKAREST_LOG4J_OPTS
value: -Dlog4j.configuration=file:/etc/kafka-rest/log4j.properties
- name: REST_PORT
value: "80"
command:
- kafka-rest-start
- /etc/kafka-rest/kafka-rest.properties
Expand Down
9 changes: 9 additions & 0 deletions connect-test-debezium/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debezium/connect:0.6

# Deploy PostgreSQL JDBC Driver
RUN cd /kafka/libs && curl -sO https://jdbc.postgresql.org/download/postgresql-42.1.4.jar

# Deploy Kafka Connect JDBC
ENV KAFKA_CONNECT_JDBC_DIR=$KAFKA_CONNECT_PLUGINS_DIR/kafka-connect-jdbc
RUN mkdir $KAFKA_CONNECT_JDBC_DIR && cd $KAFKA_CONNECT_JDBC_DIR &&\
curl -sO http://packages.confluent.io/maven/io/confluent/kafka-connect-jdbc/3.3.0/kafka-connect-jdbc-3.3.0.jar
5 changes: 5 additions & 0 deletions connect-test-debezium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Testing kafka-connect in a kubernetes context

This `connect-debezium-test` feature branch is an attempt to get this demonstration [blog post](http://debezium.io/blog/2017/09/25/streaming-to-another-database/) from debezium running. Debezium are behind a number of source connectors that facilitate change-data-capture from mySQL and postgres. The also have a source connector for mongodb.

This particular demo uses the mySQL source connector and combines with the Confluent [kafka-connect-jdbc](https://github.com/confluentinc/kafka-connect-jdbc) sink connector in order to replicate changes from the mySQL database to the postgres database via a kafka message bus.
34 changes: 34 additions & 0 deletions connect-test-debezium/connect-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: connect
namespace: kafka
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: connect
spec:
containers:
- env:
- name: BOOTSTRAP_SERVERS
value: broker.kafka:9092
- name: CONFIG_STORAGE_TOPIC
value: my_connect_configs
- name: GROUP_ID
value: "1"
- name: OFFSET_STORAGE_TOPIC
value: my_connect_offsets
- name: REST_PORT
value: "80"
image: analect/connect-deb-jdbc:0.6
name: connect
ports:
- containerPort: 8083
- containerPort: 5005
resources: {}
restartPolicy: Always
status: {}
17 changes: 17 additions & 0 deletions connect-test-debezium/connect-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: connect
namespace: kafka
spec:
ports:
- name: "8083"
port: 8083
targetPort: 8083
- name: "5005"
port: 5005
targetPort: 5005
selector:
io.kompose.service: connect
status:
loadBalancer: {}
29 changes: 29 additions & 0 deletions connect-test-debezium/mysql-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: mysql
namespace: kafka
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: mysql
spec:
containers:
- env:
- name: MYSQL_PASSWORD
value: mysqlpw
- name: MYSQL_ROOT_PASSWORD
value: debezium
- name: MYSQL_USER
value: mysqluser
image: debezium/example-mysql:0.6
name: mysql
ports:
- containerPort: 3306
resources: {}
restartPolicy: Always
status: {}
14 changes: 14 additions & 0 deletions connect-test-debezium/mysql-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: mysql
namespace: kafka
spec:
ports:
- name: "3306"
port: 3306
targetPort: 3306
selector:
io.kompose.service: mysql
status:
loadBalancer: {}
29 changes: 29 additions & 0 deletions connect-test-debezium/postgres-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: postgres
namespace: kafka
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: postgres
spec:
containers:
- env:
- name: POSTGRES_DB
value: inventory
- name: POSTGRES_PASSWORD
value: postgrespw
- name: POSTGRES_USER
value: postgresuser
image: debezium/postgres:9.6
name: postgres
ports:
- containerPort: 5432
resources: {}
restartPolicy: Always
status: {}
14 changes: 14 additions & 0 deletions connect-test-debezium/postgres-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: kafka
spec:
ports:
- name: "5432"
port: 5432
targetPort: 5432
selector:
io.kompose.service: postgres
status:
loadBalancer: {}