What does this script do?
- Go through all the PVs in K8S env
- Filter only iSCSI vols
- Find the volumes with PVs name on SolidFire cluster
- Remove all volume pair for these volumes
- Change volume access type to readWrite for all volumes
- update iqn and target portal for this PV and replace PV
Prerequisites:
- All primary SolidFire Volumes (corresponiding to PVs in K8S) have a replicated volume on the secondary SolidFire with exactly the same name.
- The secondary solidFire cluster already has VAGs defined and all volumes are already added to the corresponding VAGs.
Post steps:
- After the script has completed, all pods must be restarted for new iSCSI connections to establish.
Note:
- The script is limited to exactly what it says it does.
Steps to execute :
- Clone repo
- Change directory
cd sf-failover-k8s/
- Setup your profile with kubernetes and SF details. Edit file named profile (set NO_EXECUTE=true for a dry run)
- Create your virtualenv:
virtualenv venv
- Activate your virtualenv:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Setup Env variables using profile file created in step 1 :
source profile
- Execute failover script:
python failover.py