I'm trying to deploy the Confluent for Kafka (zookeeper statefulset) and part of the documentation mentions that I should be able to resize it, meaning that my storageclass should have allowVolumeExpansion: true
set.
While the listed supported on-prem storage solutions are only Ceph RBD and Portworx, if not using Dynamic Provisioning, the given example is of provisioner no-provisioner
.
I would like to know if using a storageclass provisioner with no-provisioner
does not actually allow me to resize the persistent storage volumes.
For reference:
My SC manifest is as below:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: my-storage-class
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
reclaimPolicy: Retain
I am able to create it.
As for the PV manifest, it is as below:
apiVersion: v1
kind: PersistentVolume
metadata:
name: data1
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: my-storage-class
local:
path: /mnt/app/data1
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- node1
Then, I follow the steps below:
Once I exec into the Pod and check the FS size, it still shows 10Gb.
The issue was Linux side, I forgot to run resize2fs.
That's correct, you cannot set allowVolumeExpansion: true
when using no-provisioner
type of StorageClass (you can but it won't work). Supported types are listed here.
Expanding Persistent Volume Claims is also not supported in this type of storage.
The workaround you can try is to: