Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active January 18, 2022 01:01
Show Gist options
  • Save vfarcic/945ab1e68afa9e49f85cec3bc6df4959 to your computer and use it in GitHub Desktop.
Save vfarcic/945ab1e68afa9e49f85cec3bc6df4959 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 3 \
--memory 3072
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
##################
# Install Tiller #
##################
kubectl create \
-f https://raw.githubusercontent.com/vfarcic/k8s-specs/master/helm/tiller-rbac.yml \
--record --save-config
helm init --service-account tiller
kubectl -n kube-system \
rollout status deploy tiller-deploy
#######################
# Destroy the cluster #
#######################
minishift delete -f --clear-cache
# Only if creating the cluster fails with `The server uses a certificate signed by unknown authority` message
# rm -rf ~/.minishift
# rm -rf ~/.kube/*_8443
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment