There are 2 variants one is slim and can be used for producing / consuming messages and the other one is the full version which includes also build tools maven and gradle.
docker run -it --rm spoud/kafka-toolbox:slim
docker run -it --rm spoud/kafka-toolbox:latest
When environment variables are set, they will be used by the various tools in the toolbox to connect to the Kafka cluster and perform their operations.
| Variable | Meaning |
|---|---|
| BOOTSTRAP_SERVER / BOOTSTRAP_SERVERS | Hostname:port or comma-separated list of brokers used to connect to the Kafka cluster |
| PROTOCOL | Protocol to be used for the connection (e.g. PLAINTEXT, SASL_SSL) |
| KAFKA_SASL_MECHANISM | SASL mechanism to be used (e.g. PLAIN, SCRAM-SHA-256) |
| KAFKA_USER | Username for SASL authentication |
| KAFKA_PASSWORD | Password for SASL authentication |
| TLS_CA | Optional path or inline content for TLS CA to configure mTLS / TLS trust for clients (applied to kafkactl, kcat, kaf, kafi) |
| TLS_CERT | Optional path or inline content for client TLS certificate (applied to kafkactl, kcat, kaf, kafi) |
| TLS_KEY | Optional path or inline content for client TLS private key (applied to kafkactl, kcat, kaf, kafi) |
| TLS_INSECURE | Optional boolean (true/false). If true, skip TLS verification for tools that support this option (use with caution) |
| CCLOUD_API_KEY | Confluent Cloud API Key |
| CCLOUD_API_SECRET | Confluent Cloud API Secret |
| SCHEMA_REGISTRY_URL | URL to the schema registry |
| SR_API_KEY | Schema Registry API Key |
| SR_API_SECRET | Schema Registry API Secret |
| CONNECT_URL | URL to kafka connect rest endpoint |
For Strimzi-managed OAUTHBEARER listeners, the slim and full images now also ship the Strimzi OAuth client classes, including io.strimzi.kafka.oauth.client.JaasClientOauthLoginCallbackHandler. That enables JAAS configs using oauth.access.token.location with projected or pre-obtained JWT token files.
For Keycloak federated client authentication, the slim and full images also ship
io.spoud.oauth.KeycloakFederatedLoginCallbackHandler from
kafka-oauth-extensions, so Kubernetes workloads can exchange a projected
ServiceAccount token for a Keycloak access token without a static client secret.
The toolbox image downloads kafka-oauth-extensions from the published GitHub
release artifacts during the Docker build. The default version is
1.5-SNAPSHOT, which contains the federated Keycloak callback handler.
You can run the toolbox on kubernetes cluster as a pod. Here is an example manifest file:
kubectl apply -f - <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-toolbox-deployment
spec:
selector:
matchLabels:
app: kafka-toolbox
replicas: 1
template:
metadata:
labels:
app: kafka-toolbox
spec:
securityContext:
fsGroup: 1000660000 # choose an allowed GID from your cluster policy
volumes:
- name: home
emptyDir:
sizeLimit: "200Mi"
- name: tmp
emptyDir:
sizeLimit: "200Mi"
containers:
- name: kafka-toolbox
image: spoud/kafka-toolbox:latest
command: ["/bin/bash"]
args: ["-c", "mkdir -p /tmp /home/kafka && chmod 1777 /tmp || true && cp -R /etc/skel/. /home/kafka/ && chown -R $(id -u):$(id -g) /home/kafka/ || true; sleep infinity"]
volumeMounts:
- name: home
mountPath: /home/kafka
- name: tmp
mountPath: /tmp
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
privileged: false
runAsNonRoot: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
resources:
requests:
memory: "256Mi"
cpu: "250m"
ephemeral-storage: "200Mi"
limits:
memory: "1Gi"
cpu: "2000m"
ephemeral-storage: "1Gi"
EOF
kubectl apply -f - <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-toolbox-slim-deployment
spec:
selector:
matchLabels:
app: kafka-toolbox-slim
replicas: 1
template:
metadata:
labels:
app: kafka-toolbox-slim
spec:
securityContext:
fsGroup: 1000660000 # choose an allowed GID from your cluster policy
volumes:
- name: home
emptyDir:
sizeLimit: "200Mi"
- name: tmp
emptyDir:
sizeLimit: "200Mi"
containers:
- name: kafka-toolbox-slim
image: spoud/kafka-toolbox:slim
command: ["/bin/bash"]
args: ["-c", "mkdir -p /tmp /home/kafka && chmod 1777 /tmp || true && cp -R /etc/skel/. /home/kafka/ && chown -R $(id -u):$(id -g) /home/kafka/ || true; sleep infinity"]
volumeMounts:
- name: home
mountPath: /home/kafka
- name: tmp
mountPath: /tmp
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
privileged: false
runAsNonRoot: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
resources:
requests:
memory: "256Mi"
cpu: "250m"
ephemeral-storage: "200Mi"
limits:
memory: "1Gi"
cpu: "2000m"
ephemeral-storage: "1Gi"
EOF
You can use the ksqlDB datagen tool to generate sample data into your Kafka topics. Here is an example command to generate data:
ksql-datagen quickstart=orders format=avro topic=orders maxInterval=1000 iterations=1000
Content type
Image
Digest
sha256:b6b6a4933…
Size
3.1 GB
Last updated
20 days ago
docker pull spoud/kafka-toolbox