首页 新闻 会员 周边 捐助

Altinity Kubernetes Operator 部署的 ClickHouse 如何调整 PVC 空间大小

0
悬赏园豆:30 [已解决问题] 解决于 2025-01-05 22:50

开始设置的 PVC 空间偏小了,想调大一些,修改清单文件,部署时不让修改 PVC 的大小

k8s
问题补充:

通过下面的命令查看日志

kubectl logs -n clickhouse deployment/clickhouse-operator -c clickhouse-operator --since=5m 

发现这样的错误

unable to Update PVC err: persistentvolumeclaims "data-volume-template-chi-clickhouse-db-analytics-0-0-0" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize
dudu的主页 dudu | 高人七级 | 园豆:28541
提问于:2025-01-05 20:32
< >
分享
最佳答案
0

在 StorageClass 的清单文件中添加 allowVolumeExpansion 配置

allowVolumeExpansion: true

然后修改 PersistentVolume 的 capacity

spec:
  capacity:
    storage: 20Gi

最后修改 PersistentVolumeClaim 的 resources.requests.storage

spec:
  resources:
    requests:
      storage: 20Gi

或者修改部署 clickhouse 的模板文件并更新部署

volumeClaimTemplates:
    - name: data-volume-template
    spec:
        accessModes:
        - ReadWriteOnce
        resources:
        requests:
            storage: 20Gi

就可以了

参考:Out of Storage? How to Efficiently Resize PersistentVolumes

dudu | 高人七级 |园豆:28541 | 2025-01-05 22:49
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册