CentaurusInfra / arktos

Arktos for large-scale cloud platform
Apache License 2.0
245 stars 69 forks source link

[ScaleUP and ScaleOUT]Clean old CNI configuration file before install new CNI for bridge, flannel and mizar and clean interface cni0 when shutdown scaleup cluster with bridge and flannel #1400

Closed q131172019 closed 2 years ago

q131172019 commented 2 years ago

What type of PR is this? /kind cleanup

What this PR does / why we need it: This PR is to give better development experience when switch different cniplugin.

  1. Clean old cni configuration files in the directories /etc/cni/net.d and /opt/cni/bin before new cni is installed and started with bridge, flannel or mizar
  2. Cleaning interface and ip link for cni0 to fix the conflict of cni0 associating with different ip addresses when switch different cniplugin between bridge and flannel to start scale-up cluster

By the way, this PR makes improvement to keep the consistency of local variables and global variables in hack/arktos-cni.rc

Tests have been done in the following 3 AWS environments:

Scale-up environment Ubuntu 18.04 (master + 3 workers)

Scale-up environment Ubuntu 20.04 (master + 3 workers)

Scale-out 2x2 environment Ubuntu 20.04 (2 TPs X 2 RPs and each RP with 1 worker)

Which issue(s) this PR fixes: Issue 1399 Issue 1348

Special notes for your reviewer: N/A

Does this PR introduce a user-facing change?: N/A

zmn223 commented 2 years ago

/lgtm

zmn223 commented 2 years ago

/approve

centaurus-cloud-bot commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Sindica, sonyafenge, zmn223

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/CentaurusInfra/arktos/blob/master/OWNERS)~~ [zmn223] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment