Created
October 4, 2022 17:05
-
-
Save atomatt/f53cb3ff5597915e91e62fc497dc2e6c to your computer and use it in GitHub Desktop.
Simplest Kafka in K8s possible?
This file contains hidden or 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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: kafka | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: kafka | |
| template: | |
| metadata: | |
| labels: | |
| app: kafka | |
| spec: | |
| containers: | |
| - name: kafka | |
| image: quay.io/strimzi/kafka:latest-kafka-3.0.1 | |
| command: | |
| - sh | |
| - -c | |
| - | | |
| set -eux | |
| export CLUSTER_ID="$(bin/kafka-storage.sh random-uuid)" | |
| bin/kafka-storage.sh format -t "${CLUSTER_ID}" -c config/kraft/server.properties | |
| bin/kafka-server-start.sh config/kraft/server.properties --override advertised.listeners="${KAFKA_ADVERTISED_LISTENERS}" | |
| env: | |
| - name: LOG_DIR | |
| value: /tmp/logs | |
| - name: KAFKA_ADVERTISED_LISTENERS | |
| value: PLAINTEXT://kafka:9092 | |
| resources: | |
| limits: | |
| memory: "1Gi" | |
| cpu: "1000m" | |
| ports: | |
| - containerPort: 9092 | |
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: kafka | |
| spec: | |
| selector: | |
| app: kafka | |
| ports: | |
| - port: 9092 | |
| targetPort: 9092 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment