diff --git a/ksql/ksql-config.yml b/ksql/ksql-config.yml new file mode 100644 index 00000000..2e1a3725 --- /dev/null +++ b/ksql/ksql-config.yml @@ -0,0 +1,30 @@ +kind: ConfigMap +metadata: + name: ksql-config + namespace: kafka +apiVersion: v1 +data: + ksqlserver.properties: |- + bootstrap.servers=kafka-0.broker.kafka.svc.cluster.local:9092 + application.id=ksql_server_quickstart + ksql.command.topic.suffix=commands + + listeners=http://0.0.0.0:80 + + log4j.properties: |- + log4j.rootLogger=INFO, stdout + + log4j.appender.stdout=org.apache.log4j.ConsoleAppender + log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c:%L)%n + + log4j.appender.streams=org.apache.log4j.ConsoleAppender + log4j.appender.streams.layout=org.apache.log4j.PatternLayout + log4j.appender.streams.layout.ConversionPattern=[%d] %p %m (%c:%L)%n + + log4j.logger.kafka=ERROR, stdout + log4j.logger.org.apache.kafka.streams=INFO, streams + log4j.additivity.org.apache.kafka.streams=false + log4j.logger.org.apache.zookeeper=ERROR, stdout + log4j.logger.org.apache.kafka=ERROR, stdout + log4j.logger.org.I0Itec.zkclient=ERROR, stdout diff --git a/ksql/ksql-service.yml b/ksql/ksql-service.yml new file mode 100644 index 00000000..2668592e --- /dev/null +++ b/ksql/ksql-service.yml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: ksql + namespace: kafka +spec: + ports: + - port: 80 + selector: + app: ksql diff --git a/ksql/ksql.yml b/ksql/ksql.yml new file mode 100644 index 00000000..f4fd3a0c --- /dev/null +++ b/ksql/ksql.yml @@ -0,0 +1,37 @@ +apiVersion: apps/v1beta1 +kind: Deployment +metadata: + name: ksql + namespace: kafka +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0 + maxSurge: 1 + template: + metadata: + labels: + app: ksql + spec: + containers: + - name: ksql + image: solsson/kafka-ksql@sha256:0ecd9e9042f422ac5856a306c7ada0c52046cbe9e0612cba6ed75b6260f2c101 + readinessProbe: + httpGet: + path: / + port: 80 + livenessProbe: + httpGet: + path: / + port: 80 + ports: + - containerPort: 80 + volumeMounts: + - name: config + mountPath: /etc/ksql-rest-app + volumes: + - name: config + configMap: + name: ksql-config diff --git a/ksql/test/ksql-basic-tail.yml b/ksql/test/ksql-basic-tail.yml new file mode 100644 index 00000000..ea33b44b --- /dev/null +++ b/ksql/test/ksql-basic-tail.yml @@ -0,0 +1,72 @@ +--- +kind: ConfigMap +metadata: + name: ksql-basic-tail + namespace: test-kafka +apiVersion: v1 +data: + + setup.sh: |- + touch /tmp/testlog + + echo "Nothing happens in this test yet. To get a KSQL prompt run something like:" >> /tmp/testlog + echo "kubectl -n test-kafka exec -ti $(hostname) -- ksql-cli remote http://ksql.kafka" >> /tmp/testlog + + tail -f /tmp/testlog + + continue.sh: |- + exit 0 + + run.sh: |- + exit 0 + +--- +apiVersion: apps/v1beta1 +kind: Deployment +metadata: + name: ksql-basic-tail + namespace: test-kafka +spec: + replicas: 1 + template: + metadata: + labels: + test-target: kafka + test-type: readiness + spec: + containers: + - name: testcase + image: solsson/kafka-ksql@sha256:0ecd9e9042f422ac5856a306c7ada0c52046cbe9e0612cba6ed75b6260f2c101 + env: + - name: BOOTSTRAP + value: kafka-0.broker.kafka.svc.cluster.local:9092 + - name: ZOOKEEPER + value: zookeeper.kafka.svc.cluster.local:2181 + # Test set up + command: + - /bin/bash + - -e + - /test/setup.sh + # Test run, again and again + readinessProbe: + exec: + command: + - /bin/bash + - -e + - /test/run.sh + # JVM start is slow, can we keep producer started and restore the default preriod 10s? + periodSeconds: 30 + # Test quit on nonzero exit + livenessProbe: + exec: + command: + - /bin/bash + - -e + - /test/continue.sh + volumeMounts: + - name: config + mountPath: /test + volumes: + - name: config + configMap: + name: ksql-basic-tail