first commit

This commit is contained in:
Hoang Nguyen
2026-04-30 13:21:52 +02:00
commit 8a3176ea01
7 changed files with 140 additions and 0 deletions

18
dev/apps/kafka.yaml Normal file
View File

@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1beta2
kind: Application
metadata:
name: kafka-dev
namespace: argocd
spec:
project: default
source:
repoURL: https://gitea.vhn-demo.duckdns.org/devops-infra.git
targetRevision: HEAD
path: manifests/kafka
destination:
server: https://kubernetes.default.svc
namespace: kafka
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@@ -0,0 +1,27 @@
apiVersion: argoproj.io/v1beta2
kind: Application
metadata:
name: strimzi-operator
namespace: argocd
spec:
project: default
source:
repoURL: https://strimzi.io/charts/
chart: strimzi-kafka-operator
targetRevision: 0.39.0
helm:
releaseName: strimzi
values:
watchAnyNamespace: true
destination:
server: https://kubernetes.default.svc
namespace: strimzi
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View File

@@ -0,0 +1,39 @@
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
name: kafka-dev
namespace: kafka
annotations:
strimzi.io/node-pools: enabled
strimzi.io/kraft: enabled
spec:
kafka:
version: 4.1.1
metadataVersion: 4.1-IV0
listeners:
- name: plain
port: 9092
type: internal
tls: false
- name: external
port: 9094
type: nodeport
tls: false
configuration:
bootstrap:
nodePort: 30092
brokers:
- broker: 0
nodePort: 30093
advertisedHost: localhost # Required for Docker Desktop
advertisedPort: 30093
config:
offsets.topic.replication.factor: 1
transaction.state.log.replication.factor: 1
transaction.state.log.min.isr: 1
default.replication.factor: 1
min.insync.replicas: 1
auto.create.topics.enable: false # Production best practice
entityOperator:
topicOperator: {}
userOperator: {}

View File

@@ -0,0 +1,21 @@
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
name: dual-role
namespace: kafka
labels:
strimzi.io/cluster: kafka-dev
spec:
replicas: 1
roles:
- controller
- broker
storage:
type: ephemeral # Use persistent-claim for production
resources:
requests:
memory: 512Mi # Works on 8GB machines
cpu: 200m
limits:
memory: 1Gi # Increase to 2Gi for 16GB+ machines
cpu: 500m

View File

@@ -0,0 +1,13 @@
apiVersion: kafka.strimzi.io/v1
kind: KafkaTopic
metadata:
name: task-events
namespace: kafka
labels:
strimzi.io/cluster: kafka-dev
spec:
partitions: 3
replicas: 1
config:
retention.ms: "604800000" # 7 days
cleanup.policy: delete

18
dev/kafka/kafka-user.yaml Normal file
View File

@@ -0,0 +1,18 @@
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
name: app-user
namespace: kafka
labels:
strimzi.io/cluster: kafka-dev
spec:
authentication:
type: tls
authorization:
type: simple
acls:
- resource:
type: topic
name: orders
patternType: literal
operation: Read

4
dev/kafka/namespace.yaml Normal file
View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: kafka