gpt4 book ai didi

azure - Strimzi 无法调整 PV 大小

转载 作者:行者123 更新时间:2023-12-03 03:44:54 32 4
gpt4 key购买 nike

我关注了 Strimzi blog调整 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,将资源请求改为257Gi。我等了几分钟,检查了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重新部署kafka,调整大小并进行滚动更新。与上面相同的结果

  • openshift v3.11.0+cbab8ee-94(K8s v1.11.0+d4cacc0)
  • Kafka 版本: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>

我尝试使用ocscalereplica=0sts/XX-dev将replica缩小到0,但是由于复制因素,cluster-operator不允许。

最佳答案

Normally Azure Disk 支持调整持久卷的大小,但目前在合规性和实现方面存在一些问题 check here

所以在去任何其他地方之前;只需再检查一次以下几点即可

另一个问题是,如果底层容量不足以调整大小,则必须在新资源组中取消分配和重新定位虚拟机。是的,云不是无限的

关于azure - Strimzi 无法调整 PV 大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69519063/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com