【问题标题】:Increasing PVC size for statefull set in kubernetes增加 Kubernetes 中 statefulset 的 PVC 大小
【发布时间】:2021-03-10 07:32:00
【问题描述】:

我想将我的 pvc 大小从 50 GB 增加到 100 GB,请您帮忙。

EFK 部署在 Azure kubernetes Cluster 上,存储类型为 azurefile-standard-zrs

我已经使用 helm 将 Elasticsearch 部署为 statefullset,尝试更新 values.yaml 文件,但没有发生。

NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
logging-es      es              6               2021-02-23 16:01:17.013698 +0000 UTC    deployed        opendistro-es-1.13.0    1.13.0
[@ .kube]$ kubectl get pvc -n es
NAME                                     STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS             AGE
data-logging-es-opendistro-es-data-0     Bound    pvc-e926bbfc-a873-4543-9867-234bc508977c   50Gi       RWO            azurefile-standard-zrs   53d
data-logging-es-opendistro-es-data-1     Bound    pvc-0f5e7e46-5138-45da-90e6-0dfbe0aadff3   50Gi       RWO            azurefile-standard-zrs   53d
data-logging-es-opendistro-es-master-0   Bound    pvc-e8a57019-5eeb-4a93-ba02-3f1b5c2e8fc8   20Gi       RWO            azurefile-standard-zrs   53d
data-logging-es-opendistro-es-master-1   Bound    pvc-2ea1845d-7d08-4fca-b3c4-5b067559af3c   20Gi       RWO            azurefile-standard-zrs   53d
[@ .kube]$ kubectl get pvc data-logging-es-opendistro-es-data-0 -n es -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/azure-file
    volume.kubernetes.io/selected-node: azwe-wvm-0
  creationTimestamp: "2021-01-15T07:25:20Z"
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    app: logging-es-opendistro-es
    heritage: Helm
    release: logging-es
    role: data
  name: data-logging-es-opendistro-es-data-0
  namespace: es
  resourceVersion: "33101689"
  selfLink: /api/v1/namespaces/es/persistentvolumeclaims/data-logging-es-opendistro-es-data-0
  uid: e926bbfc-a873-4543-9867-234bc508977c
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi
  storageClassName: azurefile-standard-zrs
  volumeMode: Filesystem
  volumeName: pvc-e926bbfc-a873-234bc508977c
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 50Gi
  phase: Bound

尝试 helm 升级时出错

$ helm upgrade -f values_runtime.yaml logging-es infrastructure/opendistro-es -n es --kubeconfig=/home/tsiadm/qa_fmo_config
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/tsiadm/qa_fmo_config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/tsiadm/qa_fmo_config
Error: UPGRADE FAILED: cannot patch "logging-es-opendistro-es-data" with kind StatefulSet: StatefulSet.apps "logging-es-opendistro-es-data" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden```

【问题讨论】:

  • 您能否提供您运行的实际命令、Helm 图表的相关片段以及您在helm upgrade 上使用的值?仅您提供的诊断输出不足以调试图表。
  • 添加到问题部分

标签: azure elasticsearch kubernetes-helm kubernetes-pvc


【解决方案1】:

几件事:

  1. 确保启用用于此 pvc 的存储类以进行卷扩展
  2. 编辑 pvc 以请求更多空间
  3. 将有状态集缩减为 0 个副本
  4. 等待 pvc 放大
  5. 将您的有状态集扩展到它需要的任何副本

【讨论】:

    猜你喜欢
    • 2018-11-02
    • 2021-06-08
    • 2019-05-24
    • 2021-09-26
    • 2019-04-10
    • 1970-01-01
    • 2021-03-29
    • 2021-02-07
    • 2021-02-25
    相关资源
    最近更新 更多