Fix Job migrate upgrade failed
What this PR dose?
- Delete Job
migrate
before executing commandhelm upgrade
. Because 'helm upgrade' will try to update immutable fields of Job, which is not allowed. - Refine existing PVC named ks-jenkins check. If PVC named
ks-jenkins
exists, we will use it fordevops-jenkins
deployment. If not, we will usedevops-jenkins
as name of PVC by default.
Which issue dose this PR fix?
Fix #1701 (closed)
Steps to test
I built a docker image for test:
johnniang/ks-installer:bug-helm-upgrade-after-v3.2-dev
-
Install KubeSphere with version
nightly-latest
by using ks.ks install kk --components devops --version nightly-latest --zone=""
-
Remove status of DevOps in
ClusterConfiguration
ks-installer
kubectl patch -nkubesphere-system cc ks-installer --type=json -p='[{"op": "remove", "path": "/status/devops"}]'
-
Replace image of ks-installer
kubectl patch -nkubesphere-system deployment ks-installer --type=merge -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image"}, "value": "johnniang/ks-installer:bug-helm-upgrade-after-v3.2-dev"]'
-
Wait for upgrading
kubectl logs -n kubesphere-system deploy/ks-installer -f
/kind bug /area devops /cc @kubesphere/sig-installation /cc @kubesphere/sig-devops /cc @zryfish