增加kubernetes中状态集的PVC大小



我想把pvc的大小从50gb增加到100GB,你能帮我一下吗?

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

我已经部署了Elasticsearch作为一个使用helm的statfullset,尝试更新值。

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 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```

两件事:

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

相关内容

  • 没有找到相关文章

最新更新