kubesphere / ks-installer

Install KubeSphere on existing Kubernetes cluster
https://kubesphere.io
Apache License 2.0
527 stars 744 forks source link

ks-installer failed when upgrading from v3.1.0 to v3.2.0-alpha.0 #1700

Open zryfish opened 3 years ago

zryfish commented 3 years ago

My environment is v3.1.0 HA with three masters and three nodes

root@master1:~# kubectl get node
NAME      STATUS   ROLES                  AGE    VERSION
master1   Ready    control-plane,master   460d   v1.21.5
master2   Ready    control-plane,master   460d   v1.21.5
master3   Ready    control-plane,master   460d   v1.21.5
node1     Ready    worker                 460d   v1.21.5
node2     Ready    worker                 243d   v1.21.5
node3     Ready    worker                 460d   v1.21.5

root@master1:~# kubectl -n kubesphere-system get po
NAME                                     READY   STATUS      RESTARTS   AGE
ks-apiserver-687887f88c-bqfxv            1/1     Running     16         32d
ks-console-5fd458958f-psch8              1/1     Running     3          29d
ks-controller-manager-55b8d48fb8-lkxdg   1/1     Running     4          33d
ks-installer-f49df5dfb-bwl2j             1/1     Running     0          15m
minio-574d985d9b-tg8qw                   1/1     Running     2          27d
openldap-0                               1/1     Running     5          85d
openldap-1                               1/1     Running     3          85d
openpitrix-import-job-j7pnq              0/1     Completed   6          132d
redis-ha-haproxy-5ddf967bf9-g29b6        1/1     Running     0          34s
redis-ha-haproxy-5ddf967bf9-nst5j        1/1     Running     0          58s
redis-ha-haproxy-5ddf967bf9-td79s        1/1     Running     0          47s
redis-ha-server-0                        2/2     Running     7          83d
redis-ha-server-1                        2/2     Running     4          83d
redis-ha-server-2                        2/2     Running     4          83d
tower-65dff4f54c-2ss7n                   1/1     Running     3          90d
TASK [common : KubeSphere | Deploying redis] ***********************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "/usr/local/bin/helm upgrade --install ks-redis /kubesphere/kubesphere/redis-ha -f /kubesphere/kubesphere/custom-values-redis.yaml --set fullnameOverride=redis-ha --namespace kubesphere-system\n", "delta": "0:00:01.372789", "end": "2021-09-22 04:44:48.371317", "msg": "non-zero return code", "rc": 1, "start": "2021-09-22 04:44:46.998528", "stderr": "Error: UPGRADE FAILED: cannot patch \"redis-ha-server\" with kind StatefulSet: StatefulSet.apps \"redis-ha-server\" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden", "stderr_lines": ["Error: UPGRADE FAILED: cannot patch \"redis-ha-server\" with kind StatefulSet: StatefulSet.apps \"redis-ha-server\" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden"], "stdout": "", "stdout_lines": []}
zryfish commented 3 years ago

In my env, redis volume size still be

common:
  redisVolumeSize: 2Gi

which is exactly the same with https://github.com/kubesphere/ks-installer/blob/v3.1.0/deploy/cluster-configuration.yaml#L27

But, in the latest branch, the field became

common:
  redis:
    volumeSize: 2Gi