kafka
БесплатноЗапускает вложенные скриптыНе проверенApache Kafka on Kubernetes with Strimzi (KRaft mode, no ZooKeeper). This skill should be used when users ask to deploy Kafka clusters, build…
от mjunaidca★ 27 звёзд на GitHubОб этом скилле
Apache Kafka
Event streaming for Kubernetes. Strimzi operator, KRaft mode, no ZooKeeper.
Quick Start (Tested)
make install # Deploy Strimzi + Kafka
make test # Verify everything works
make status # Show resources
make uninstall # Clean up
Requirements: Kubernetes cluster, Helm 3+
Versions: Strimzi 0.49+, Kafka 4.1.1
Resource Detection & Adaptation
Before generating manifests, detect the target environment:
# Detect machine memory
sysctl -n hw.memsize 2>/dev/null | awk '{print $0/1024/1024/1024 " GB"}' || \
grep MemTotal /proc/meminfo | awk '{print $2/1024/1024 " GB"}'
# Detect Docker Desktop allocation
docker info --format '{{.MemTotal}}' 2>/dev/null | awk '{print $0/1024/1024/1024 " GB"}'
# Detect Kubernetes node capacity
kubectl get nodes -o jsonpath='{.items[0].status.capacity.memory}' 2>/dev/null
Adapt resource configuration based on detection:
| Detected RAM | Profile | Kafka Memory | Action |
|---|---|---|---|
| < 12GB | Minimal | 512Mi-1Gi | Warn user about constraints |
| 12-24GB | Standard | 1Gi-2Gi | Default configuration |
| > 24GB | Production | 4Gi-8Gi | Enable full features |
Adaptive Resource Templates
Minimal (detected < 12GB):
resources:
requests:
memory: 512Mi
cpu: 200m
limits:
memory: 1Gi
cpu: 500m
⚠️ Agent should warn: "Limited resources detected. Kafka may be unstable under load."
Standard (detected 12-24GB):
resources:
requests:
memory: 1Gi
cpu: 250m
limits:
memory: 2Gi
cpu: 1000m
Production (detected > 24GB or real cluster):
resources:
requests:
memory: 4Gi
cpu: 1000m
limits:
memory: 8Gi
cpu: 4000m
Agent Behavior
- Always detect before generating manifests
- Adapt resource configs to detected environment
- Warn if resources are insufficient for requested workload
- Suggest Docker Desktop settings if running locally
What This Skill Does
| Task | How |
|---|---|
| Analyze coupling | Identify temporal, availability, behavioral issues |
| Explain eventual consistency | Consistency windows, read-your-writes patterns |
| Design events | Domain events, CloudEvents, Avro schemas |
| Deploy Kafka | Helm (Strimzi) + kubectl (manifests) |
| Create topics | KafkaTopic CRD |
| Build producers | confluent-kafka-python templates |
| Build consumers | AIOConsumer for FastAPI |
| Debug issues | Runbooks in references/ |
What This Skill Does NOT Do
- Deploy ZooKeeper (KRaft only)
- Manage Kafka Streams applications
- Configure multi-datacenter replication
Deployment
Install Strimzi Operator
helm repo add strimzi https://strimzi.io/charts
helm install strimzi-operator strimzi/strimzi-kafka-operator -n kafka --create-namespace --wait
Deploy Kafka Cluster
kubectl apply -f manifests/kafka-cluster.yaml -n kafka
kubectl wait kafka/dev-cluster --for=condition=Ready --timeout=300s -n kafka
Create Topic
kubectl apply -f manifests/kafka-topic.yaml -n kafka
Verify
kubectl get kafka,kafkatopic,pods -n kafka
Core Concepts
Topic = Named stream (like a database table)
Partition = Ordered log within topic (parallelism unit)
Consumer Group = Consumers sharing work (partition → one consumer)
Offset = Consumer position (commit to track progress)
Broker = Kafka server
Controller = Metadata manager (KRaft replaces ZooKeeper)
Local Development
Connect from your host machine (no port-forward needed):
# From your local machine (outside Kubernetes)
producer = Producer({'bootstrap.servers': 'localhost:30092'})
Connect from inside Kubernetes (pod-to-pod):
# From another pod in the cluster
producer = Producer({'bootstrap.servers': 'dev-cluster-kafka-bootstrap.kafka:9092'})
| Location | Bootstrap Server |
|---|---|
| Local machine | localhost:30092 |
| Same namespace | dev-cluster-kafka-bootstrap:9092 |
| Different namespace | dev-cluster-kafka-bootstrap.kafka.svc.cluster.local:9092 |
Producer/Consumer (Python)
from confluent_kafka import Producer, Consumer
# Producer (production config)
producer = Producer({
'bootstrap.servers': 'localhost:30092', # Or K8s service for pods
'acks': 'all',
'enable.idempotence': True,
})
producer.produce('my-topic', key='key', value='message')
producer.flush()
# Consumer
consumer = Consumer({
'bootstrap.servers': 'localhost:30092',
'group.id': 'my-group',
'auto.offset.reset': 'earliest',
'enable.auto.commit': False,
})
consumer.subscribe(['my-topic'])
msg = consumer.poll(1.0)
See assets/templates/producer-consumer.py for async FastAPI integration.
Debugging
# Check consumer lag
kubectl exec -n kafka dev-cluster-dual-role-0 -- \
bin/kafka-consumer-groups.sh --bo
Установить kafka в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл kafka?
Apache Kafka on Kubernetes with Strimzi (KRaft mode, no ZooKeeper). This skill should be used when users ask to deploy Kafka clusters, build producers/consumers, implement event-driven patterns, or debug Kafka issues. Includes tested manifests and Makefile for one-command deployment.
Как установить скилл kafka?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл kafka запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic