sudo mkdir /var/lib/local-storage/kafka-1
sudo mkdir /var/lib/local-storage/kafka-2
kubectl apply -f pv-kafka-1.yaml
kubectl apply -f pv-kafka-2.yaml
kubectl get pv
kubectl -n juplo apply -f cluster.yaml
kubectl -n juplo get pvc
kubectl -n juplo get all
spec:
kafka:
version: 3.5.1
- replicas: 1
+ replicas: 3
listeners:
- name: plain
port: 9092
type: loadbalancer
tls: false
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
+ offsets.topic.replication.factor: 3
+ transaction.state.log.replication.factor: 3
+ transaction.state.log.min.isr: 3
+ default.replication.factor: 3
+ min.insync.replicas: 2
inter.broker.protocol.version: "3.5"
storage:
type: jbod
--- /dev/null
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: pv-kafka-1
+spec:
+ capacity:
+ storage: 1Gi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ storageClassName: local-storage
+ local:
+ path: /var/lib/local-storage/kafka-1
+ nodeAffinity:
+ required:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: kubernetes.io/hostname
+ operator: In
+ values:
+ - ryzen
--- /dev/null
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: pv-kafka-2
+spec:
+ capacity:
+ storage: 1Gi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ storageClassName: local-storage
+ local:
+ path: /var/lib/local-storage/kafka-2
+ nodeAffinity:
+ required:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: kubernetes.io/hostname
+ operator: In
+ values:
+ - ryzen