See:
* https://kubernetes.io/blog/2019/04/04/kubernetes-1.14-local-persistent-volumes-ga/
* https://docs.confluent.io/operator/current/co-storage.html#use-statically-provisioned-persistent-volumes
sudo mkdir /var/lib/local-storage
sudo mkdir /var/lib/local-storage/zookeeper-0
sudo mkdir /var/lib/local-storage/kafka-0
kubectl -n juplo apply -f local-storage.yaml
kubectl apply -f pv-zookeeper-0.yaml
kubectl apply -f pv-kafka-0.yaml
kubectl get pv
kubectl -n juplo apply -f cluster.yaml
kubectl -n juplo get pvc
kubectl -n juplo get pvc/data-0-juplo-kafka-0 -o yaml
volumes:
- id: 0
type: persistent-claim
+ class: local-storage
size: 1Gi
deleteClaim: false
zookeeper:
storage:
storage:
type: persistent-claim
+ class: local-storage
size: 500Mi
deleteClaim: false
entityOperator:
--- /dev/null
+apiVersion: storage.k8s.io/v1
+kind: StorageClass
+metadata:
+ name: local-storage
+provisioner: kubernetes.io/no-provisioner
+volumeBindingMode: WaitForFirstConsumer
--- /dev/null
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: pv-kafka-0
+spec:
+ capacity:
+ storage: 1Gi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ storageClassName: local-storage
+ local:
+ path: /var/lib/local-storage/kafka-0
+ nodeAffinity:
+ required:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: kubernetes.io/hostname
+ operator: In
+ values:
+ - ryzen
--- /dev/null
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: pv-zookeeper-0
+spec:
+ capacity:
+ storage: 500Mi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ storageClassName: local-storage
+ local:
+ path: /var/lib/local-storage/zookeeper-0
+ nodeAffinity:
+ required:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: kubernetes.io/hostname
+ operator: In
+ values:
+ - ryzen