From 41d5513844af69a35680f8f3c9672ed9f14b2ad6 Mon Sep 17 00:00:00 2001 From: deusebio Date: Mon, 8 Apr 2024 14:49:41 +0200 Subject: [PATCH] [DPE-3233] Apache Kafka <> OCI Factory Integration (#155) --- oci/kafka/.trivyignore | 2 + oci/kafka/contacts.yaml | 6 +++ oci/kafka/documentation.yaml | 88 ++++++++++++++++++++++++++++++++++++ oci/kafka/image.yaml | 11 +++++ 4 files changed, 107 insertions(+) create mode 100644 oci/kafka/.trivyignore create mode 100644 oci/kafka/contacts.yaml create mode 100644 oci/kafka/documentation.yaml create mode 100644 oci/kafka/image.yaml diff --git a/oci/kafka/.trivyignore b/oci/kafka/.trivyignore new file mode 100644 index 00000000..4ccd8c52 --- /dev/null +++ b/oci/kafka/.trivyignore @@ -0,0 +1,2 @@ +# CVEs in upstream + diff --git a/oci/kafka/contacts.yaml b/oci/kafka/contacts.yaml new file mode 100644 index 00000000..c31582e7 --- /dev/null +++ b/oci/kafka/contacts.yaml @@ -0,0 +1,6 @@ +# Who and how to notify about the build progress. +notify: + emails: + - data-platform@lists.launchpad.net + mattermost-channels: + - wxppdtg4obdg9csp9wxnqs1wqw # alerts on DataPlatform OCI channel diff --git a/oci/kafka/documentation.yaml b/oci/kafka/documentation.yaml new file mode 100644 index 00000000..1cfc187a --- /dev/null +++ b/oci/kafka/documentation.yaml @@ -0,0 +1,88 @@ +version: 1 +application: kafka +is_chiselled: False +description: | + Current Apache Kafka Docker Image from Canonical, based on Ubuntu. + Receives security updates and tracks the newest combination of Apache + Kafka and Ubuntu. **This repository is free to use and exempted from + per-user rate limits.** + + # About Apache Kafka + Apache Kafka is an open-source distributed event streaming platform for + high-performance data pipelines, streaming analytics and integrations. + Read more on the [Apache Kafka website](https://kafka.apache.org/). + This image requires the + [Apache Zookeeper image](https://hub.docker.com/r/ubuntu/zookeeper) + to run properly. + + Please note that the images tagged up to 3.1 are Dockerfile-base images, + whereas from version 3.6.1 onward the images are now ROCKs. As such the + entrypoint is now Pebble. Read more on the + [Rockcraft docs](https://canonical-rockcraft.readthedocs-hosted.com/en/latest/explanation/rocks/). + + # Quickstart + To deploy a single-broker dockerized version of Kafka, you need to first + deploy the ZooKeeper service and make sure that the ZooKeeper service is + reachable by Kafka. + + First, create a network + + ```bash + docker network create -d bridge kafka-network + ``` + + Deploy the ZooKeeper service + + ```bash + docker run --detach \ + --network kafka-network --name zookeeper \ + ubuntu/zookeeper:3.8-22.04_edge + ``` + + Finally, deploy the Kafka service + + ``` + docker run --detach \ + --name kafka --network kafka-network -p 9092:9092 \ + kafka:3.6-22.04_edge + ``` + +# --- USAGE INFORMATION --- +docker: + parameters: + - -p 9092:9092 + access: Access your Apache Kafka server at `http://localhost:9092`. +parameters: + - type: -e + value: 'TZ=UTC' + description: Timezone. + - type: -e + value: 'ZOOKEEPER_HOST=' + description: Hostname for the related Zookeeper instance. + - type: -e + value: 'ZOOKEEPER_PORT=2181' + description: Port for the related Zookeeper instance. + - type: -p + value: '9092:9092' + description: Expose Apache Kafka server on `localhost:2181`. + - type: -v + value: "/path/to/config/file:/etc/kafka/server.properties" + description: Local Kafka configuration file. + - type: -v + value: "kafkaData:/var/lib/kafka" + description: > + "Persist data in a docker volume named `kafkaData`. " + "Make sure that the mount point is consistent with the configuration property `logs.dirs`. +debug: + text: | + ### Debugging + + To debug the container: + ```bash + docker logs -f + ``` + + To get an interactive shell: + ```bash + docker exec -it /bin/bash + ``` \ No newline at end of file diff --git a/oci/kafka/image.yaml b/oci/kafka/image.yaml new file mode 100644 index 00000000..c4f2620f --- /dev/null +++ b/oci/kafka/image.yaml @@ -0,0 +1,11 @@ +version: 1 + +upload: + - source: "canonical/kafka-rock" + commit: edc4505e547f3c6342940276b486936bcf924e9a + directory: . + release: + 3.6-22.04: + end-of-life: "2024-05-01T00:00:00Z" + risks: + - edge