Skip to content

Commit

Permalink
optimizate spiderpool upgrade CI
Browse files Browse the repository at this point in the history
Signed-off-by: tao.yang <tao.yang@daocloud.io>
  • Loading branch information
ty-dc committed Sep 18, 2024
1 parent 32890c3 commit 2ff7e76
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/auto-upgrade-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ jobs:
- name: Upgrade to version ${{ needs.get_ref.outputs.new_version }}
id: upgrade
continue-on-error: true
run: |
RESULT=0
make upgrade_e2e_spiderpool -e E2E_CLUSTER_NAME=${{ env.E2E_CLUSTER_NAME }} \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ clean_e2e_spiderpool:

.PHONY: upgrade_e2e_spiderpool
upgrade_e2e_spiderpool:
$(QUIET) make -C test upgrade_spiderpool
$(QUIET) make -C test helm_upgrade_spiderpool

.PHONY: codegen
codegen:
Expand Down
4 changes: 4 additions & 0 deletions docs/usage/install/upgrade-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ kubectl patch sp ${auto-pool} --type merge --patch '{"metadata": {"labels": {"ip
在 0.9.4 以下的版本中,statefulSet 应用在快速扩缩容场景下,Spiderpool GC 可能会错误的回收掉 IPPool 中的 IP 地址,导致同一个 IP 被分配给 K8S 集群的多个 Pod,从而出现 IP 地址冲突。该问题已修复,参考[修复](https://github.com/spidernet-io/spiderpool/pull/3778),但在升级后,冲突的 IP 地址并不能自动被 Spiderpool 纠正回来,您需要通过手动重启冲突 IP 的 Pod 来辅助解决,在新版本中不会再出现错误 GC IP 而导致 IP 冲突的问题。
### 低于 0.9.5 (不包含 0.9.5) 升级到最高版本的注意事项
在 0.9.5 以下的版本中,Spiderpool Charts values.yaml 中的 spiderSubnet 字段发生变更,由 `ipam.spidersubnet` 变更为 `ipam.spiderSubnet`,因此,您无法可以安全地使用 `--reuse-values` 标志从 0.9.5 以下版本升级到 0.9.5 及以上版本。请修改 values.yaml 文件,或者使用 `--set ipam.spiderSubnet.enable=true` 标志来覆盖 values.yaml 文件中的值。
### 更多版本升级的注意事项
*TODO.*
Expand Down
4 changes: 4 additions & 0 deletions docs/usage/install/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ Due to the addition of the `txQueueLen` field to the [SpiderCoordinator CRD](./.
In versions below 0.9.4, when statefulSet is rapidly scaling up or down, Spiderpool GC may mistakenly reclaim IP addresses in IPPool, causing the same IP to be assigned to multiple Pods in the K8S cluster, resulting in IP address conflicts. This issue has been fixed, see [Fix](https://github.com/spidernet-io/spiderpool/pull/3778), but after the upgrade, the conflicting IP addresses cannot be automatically corrected by Spiderpool. You need to manually restart the Pod with the conflicting IP to assist in resolving the issue. In the new version, there will no longer be an issue with IP conflicts caused by incorrect GC IPs.
### Upgrading from a version below 0.9.5 (Excludes 0.9.5) to a higher version
In versions lower than 0.9.5, the spiderSubnet field in Spiderpool Charts values.yaml changed from `ipam.spidersubnet` to `ipam.spiderSubnet`, so you cannot safely use the `--reuse-values` flag to upgrade from versions < 0.9.5 to 0.9.5 and above. Please modify the values.yaml file or use the `--set ipam.spiderSubnet.enable=true` flag to override the value in the values.yaml file.
### More notes on version upgrades
*TODO.*
Expand Down
16 changes: 10 additions & 6 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,6 @@ uninstall_spiderpool:
done ; \
done

.PHONY: upgrade_spiderpool
upgrade_spiderpool:
@echo -e "\033[35m [upgrade spiderpool] \033[0m"
@make helm_upgrade_spiderpool

.PHONY: helm_upgrade_spiderpool
helm_upgrade_spiderpool:
@echo -e "\033[35m [helm upgrade spiderpool] \033[0m"
Expand All @@ -442,7 +437,16 @@ helm_upgrade_spiderpool:
--set spiderpoolInit.image.registry="" \
--set spiderpoolInit.image.repository=$(SPIDERPOOL_CONTROLLER_IMAGE_NAME) \
--set spiderpoolInit.image.tag=$(E2E_SPIDERPOOL_TAG) \
--set multus.multusCNI.uninstall=false " \
--set multus.multusCNI.uninstall=false " ; \
if [ "$(E2E_SPIDERPOOL_ENABLE_SUBNET)" == "true" ] ; then \
HELM_OPTION+=" --set ipam.spiderSubnet.enable=true " ; \
HELM_OPTION+=" --set ipam.spiderSubnet.autoPool.enable=true " ; \
HELM_OPTION+=" --set ipam.spiderSubnet.autoPool.defaultRedundantIPNumber=1 " ; \
else \
HELM_OPTION+=" --set ipam.spiderSubnet.enable=false " ; \
HELM_OPTION+=" --set ipam.spiderSubnet.autoPool.enable=true " ; \
HELM_OPTION+=" --set ipam.spiderSubnet.autoPool.defaultRedundantIPNumber=1 " ; \
fi ; \
ALL_IMAGES=`helm template $(RELEASE_NAME) $(ROOT_DIR)/charts/spiderpool $${HELM_OPTION} | grep ' image: ' | tr -d '"' | awk -F 'image: ' '{print $$2}' | sort | uniq | tr '\n' ' '` ; \
echo "ALL_IMAGES: $${ALL_IMAGES} " ; \
for IMAGE in $${ALL_IMAGES}; do \
Expand Down

0 comments on commit 2ff7e76

Please sign in to comment.