Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active January 18, 2022 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save vfarcic/c9968f23ecb1f7b2ec40c6bcc0e03e4f to your computer and use it in GitHub Desktop.
Save vfarcic/c9968f23ecb1f7b2ec40c6bcc0e03e4f to your computer and use it in GitHub Desktop.
######################
# Create The Cluster #
######################
# Make sure that your minishift version is v1.15 or higher
minishift start \
--vm-driver virtualbox \
--cpus 2 \
--memory 2048 \
--openshift-version 3.9.0
IP=$(minishift ip)
NAME=$(echo $IP | tr '.' '-')
oc config set current-context \
myproject/$NAME:8443/system:admin
# Change `myproject` to `default` if the previous command fails
#######################
# Destroy the cluster #
#######################
minishift delete -f --clear-cache
kubectl config delete-cluster $NAME:8443
kubectl config delete-cluster 127-0-0-1:8443
kubectl config delete-context /$NAME:8443/developer
kubectl config delete-context default/$NAME:8443/system:admin
kubectl config delete-context minishift
kubectl config delete-context myproject/$NAME:8443/developer
kubectl config delete-context myproject/$NAME:8443/system:admin
kubectl config delete-context default/127-0-0-1:8443/system:admin
kubectl config unset users.developer/$NAME:8443
kubectl config unset users.system:admin/$NAME:8443
kubectl config unset users.system:admin/127-0-0-1:8443
rm -rf ~/.minishift/machines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment