Last active
May 10, 2019 15:46
-
-
Save dcberg/468818e6e72f769cd607d3f047707cfe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download all IBM Cloud Kubernetes Service (IKS) cluster configurations for each cluster | |
# that the currently logged in user has access. Ensure that you have not restricted | |
# visibility to a single region using the `ibmcloud ks init` command. | |
# IBM Cloud Kubernetes Service cluster config dir | |
clustersdir=~/.bluemix/plugins/container-service/clusters | |
for arg in "$@" | |
do | |
if [ "$arg" == "-d" ] || [ "$arg" == "--delete-configs" ] | |
then | |
echo "Deleting existing IKS cluster config files." | |
rm -rf $clustersdir | |
fi | |
done | |
echo "Downloading all IKS cluster configs." | |
for i in `ibmcloud ks clusters | awk '!/Name|OK/{print $1}'`; do | |
ibmcloud ks cluster-config --export $i | awk -F "=" '{print $NF}'; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment