Strimzi: Scale: Added 2 more brokers
authorKai Moritz <kai@juplo.de>
Tue, 3 Oct 2023 14:28:43 +0000 (16:28 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 4 Oct 2023 17:51:31 +0000 (19:51 +0200)
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

strimzi-kafka/cluster.yaml
strimzi-kafka/pv-kafka-1.yaml [new file with mode: 0644]
strimzi-kafka/pv-kafka-2.yaml [new file with mode: 0644]

index 2ed0da3..266f523 100644 (file)
@@ -5,7 +5,7 @@ metadata:
 spec:
   kafka:
     version: 3.5.1
-    replicas: 1
+    replicas: 3
     listeners:
       - name: plain
         port: 9092
@@ -16,11 +16,11 @@ spec:
         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
diff --git a/strimzi-kafka/pv-kafka-1.yaml b/strimzi-kafka/pv-kafka-1.yaml
new file mode 100644 (file)
index 0000000..0c0de01
--- /dev/null
@@ -0,0 +1,22 @@
+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
diff --git a/strimzi-kafka/pv-kafka-2.yaml b/strimzi-kafka/pv-kafka-2.yaml
new file mode 100644 (file)
index 0000000..ff32f5a
--- /dev/null
@@ -0,0 +1,22 @@
+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