Skip to content

Instantly share code, notes, and snippets.

@Bowenislandsong
Last active October 10, 2019 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bowenislandsong/925e66efaea26c8b5fe8087c890256bf to your computer and use it in GitHub Desktop.
Save Bowenislandsong/925e66efaea26c8b5fe8087c890256bf to your computer and use it in GitHub Desktop.
#!/bin/bash
# move content of clusterN to cluster dir and destroy cluster
# cp install-config from current dir to clusterN and edit cluster name with random suffix
# create the OpenShift Cluster there.
# Pre-req: dir(cluster, clusterN), installer-config.yaml, and openshift-install binary.
rm -rf cluster/*
mv clusterN/* cluster/
./openshift-install destroy cluster --dir cluster &
cp install-config.yaml clusterN/
nameSufix=$RANDOM % 100000 | bc
sed -i "/^\([[:space:]]*name: bsong-winc-\).*/s//\1bsong-winc-cluster-${nameSufix}/" clusterN/install-config.yaml
./openshift-install create cluster --dir clusterN/
#!/bin/bash
# move content of clusterN to cluster dir and destroy cluster
# cp install-config from current dir to clusterN and edit cluster name with random suffix
# create the OpenShift Cluster there.
# Pre-req: dir(cluster, clusterN), installer-config.yaml, and openshift-install binary.
rm -rf cluster/*
mv clusterN/* cluster/
mv clusterN/.* cluster/
./openshift-install destroy cluster --dir cluster &
cp install-config.yaml clusterN/
nameSufix=($RANDOM % 100000)
sed -i "/^\([[:space:]]*name: bsong-winc-\).*/s//\1c${nameSufix}/" clusterN/install-config.yaml
./openshift-install create cluster --dir clusterN/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment