我跟随博客调整PV的大小。
我使用部署在Azure VM上的Openshift v3.11
和PV作为Azure托管磁盘
我的Kafka集群存储配置
..
config:
offsets.topic.replication.factor: 2
transaction.state.log.replication.factor: 1
transaction.state.log.min.isr: 1
log.message.format.version: "2.6"
storage:
type: persistent-claim
size: 256Gi
deleteClaim: false
...
我直接编辑pvc并将资源请求更改为257 to。我等了几分钟,检查了PVC的状况。
oc get pvc data-0-xx-dev-kafka-0 -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
...
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 257Gi
storageClassName: generic
volumeName: pvc-xx-2849-xx-913f-xx
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 256Gi
conditions:
- lastProbeTime: null
lastTransitionTime: 2021-10-08T15:54:06Z
status: "True"
type: Resizing
phase: Bound
在pvc的描述中,我看到下面
Warning VolumeResizeFailed 3s (x2 over 1m) volume_expand Error expanding volume "kafka/data-0-sirius-dev-kafka-0" of plugin kubernetes.io/azure-disk : compute.DisksClient#CreateOrUpdate:
Failure sending request: StatusCode=409 -- Original Error: failed request: autorest/azure:
Service returned an error. Status=<nil> Code="OperationNotAllowed" Message="Cannot resize disk kubernetes-dynamic-pvc-xx-2849-xx-913f-xx while it is
attached to running VM /subscriptions/xxxx/resourceGroups/xxx-dev-openshift/providers/Microsoft.Compute/virtualMachines/ocp-node-dev-1. Resizing a disk of an Azure Virtual Machine requires the virtual machine to be deallocated.
Please stop your VM and retry the operation."
我也尝试过,重新部署卡夫卡与jbod
与单磁盘,调整大小和做滚动更新。与上述相同的结果
v3.11.0+cbab8ee-94
(K8s v1.11.0+d4cacc0
)2.6.0
0.20.1
请注意,在我的集群中确实支持调整PV大小(以前我通过将副本缩小到零成功地调整了应用程序的PV大小)
更新
$ oc describe storageclass generic
Name: generic
IsDefaultClass: Yes
Annotations: storageclass.beta.kubernetes.io/is-default-class=true
Provisioner: kubernetes.io/azure-disk
Parameters: kind=managed,location=${location},storageaccounttype=Premium_LRS
AllowVolumeExpansion: True
MountOptions:
discard
ReclaimPolicy: Delete
VolumeBindingMode: Immediate
Events: <none>
我试图使用oc scale replicas=0 sts/XX-dev
将reaplica缩小到0,但是由于复制因素,cluster-operator
不允许使用。
发布于 2021-10-12 00:10:30
正常情况下 Azure磁盘支持对持久卷进行调整,但目前在遵从性和实现检查这里方面存在一些问题。
因此,在去其他地方之前,只需再检查一次以下几点
You can only expand a PVC if its storage class's allowVolumeExpansion field is set to true.
另一个问题是,如果底层容量不足以调整大小,则必须在新的资源组中重新定位和重新定位VM。是的,云不是无限的
https://stackoverflow.com/questions/69519063
复制相似问题