通过查看ks-install err日志:
TASK [common : Kubesphere | Deploying common component] ************************
failed: [localhost] (item=mysql.yaml) => {"ansible_loop_var": "item", "changed": true, "cmd": "/usr/local/bin/kubectl -n kubesphere-system apply -f /etc/kubesphere/common/mysql.yaml\n", "delta": "0:00:00.846942", "end": "2020-04-19 17:03:20.734303", "failed_when_result": true, "item": "mysql.yaml", "msg": "non-zero return code", "rc": 1, "start": "2020-04-19 17:03:19.887361", "stderr": "The PersistentVolumeClaim \"mysql-pvc\" is invalid: spec.resources.requests.storage: Forbidden: field can not be less than previous value", "stderr_lines": ["The PersistentVolumeClaim \"mysql-pvc\" is invalid: spec.resources.requests.storage: Forbidden: field can not be less than previous value"], "stdout": "service/mysql unchanged\ndeployment.apps/mysql unchanged", "stdout_lines": ["service/mysql unchanged", "deployment.apps/mysql unchanged"]}
mysql-pvc是通过ks界面扩容过到60G,不知道是否有关系。
1、尝试在安装配置把common.yaml里mysql_volume_size的存储为60G重新执行升级操作也报同样的err
mysql_volume_size: 60Gi
2、也通过kubectl edit pvc mysql-pvc -n kubesphere-system
修改capacity.storage=60G 保存退出,但是回头再edit看还是20G?是有限制修改吗?
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"labels":{"app":"kubesphere","tier":"db"},"name":"mysql-pvc","namespace":"kubesphere-system"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"30Gi"}},"storageClassName":"nfs-client"}}
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-provisioner: cluster.local/nfs-client-nfs-client-provisioner
creationTimestamp: "2020-01-08T08:00:18Z"
finalizers:
- kubernetes.io/pvc-protection
labels:
app: kubesphere
tier: db
name: mysql-pvc
namespace: kubesphere-system
resourceVersion: "31122181"
selfLink: /api/v1/namespaces/kubesphere-system/persistentvolumeclaims/mysql-pvc
uid: 8470073d-d3ae-4e3d-8b07-819c388b2f2f
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 60Gi
storageClassName: nfs-client
volumeMode: Filesystem
volumeName: pvc-8470073d-d3ae-4e3d-8b07-819c388b2f2f
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 20Gi
phase: Bound