cd harvester
export REPO="harbor.futuretea.me/rancher"
export PUSH=true
make
make build-iso
cd dist/artifacts
name="v1.2-head"
target="dev:/mnt/www/share/box/harvester/upgrade/"
isoChecksum=$(sha512sum harvester-master-amd64.iso | awk '{print $1}')
releaseDate=$(date +"%Y%m%d")
cat > /tmp/version.yaml <<EOF
apiVersion: harvesterhci.io/v1beta1
kind: Version
metadata:
name: ${name}
namespace: harvester-system
spec:
isoChecksum: "${isoChecksum}"
isoURL: http://192.168.5.79/box/harvester/upgrade/harvester-master-amd64.iso
releaseDate: "${releaseDate}"
EOF
cat > /tmp/upgrade.yaml <<EOF
apiVersion: harvesterhci.io/v1beta1
kind: Upgrade
metadata:
generateName: hvst-upgrade-
namespace: harvester-system
spec:
version: ${name}
EOF
scp /tmp/version.yaml ${target}
scp /tmp/upgrade.yaml ${target}
scp harvester-master-amd64.iso ${target}
cat > /tmp/fix.yaml <<EOF
spec:
values:
systemUpgradeJobActiveDeadlineSeconds: "3600"
EOF
kubectl --namespace fleet-local patch managedcharts.management.cattle.io local-managed-system-upgrade-controller --patch-file=/tmp/fix.yaml --type merge
kubectl -n cattle-system rollout restart deploy/system-upgrade-controller
kubectl --namespace fleet-local get managedcharts.management.cattle.io local-managed-system-upgrade-controller -oyaml
manifestsURL="http://192.168.5.79/box/harvester/upgrade"
kubectl -n harvester-system delete upgrades.harvesterhci.io --all
kubectl create -f ${manifestsURL}/version.yaml
kubectl create -f ${manifestsURL}/upgrade.yaml
watch 'kubectl -n harvester-system get upgrades.harvesterhci.io -oyaml'