-
-
Save cbron/8513057ecb25c24c20cb28b3dadba854 to your computer and use it in GitHub Desktop.
k3d local development script
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 | |
#set -x | |
#set -e | |
# Run with: k3dStart test | |
# This will remove and recreate a k3s cluster named test | |
[[ -z "$1" ]] && { echo "You must specify a cluster name" ; exit 1; } | |
name=$1 | |
k3d delete --name=$name | |
k3d create --workers 0 --image rancher/k3s:v0.9.1 -n $name --publish 80:80 --publish 443:443 | |
declare -i i; i=0 | |
until k3d get-kubeconfig --name=$name 2>/dev/null | |
do | |
if (( i > 20 )); then | |
break | |
fi | |
sleep 2 | |
i+=1 | |
done | |
if [ "$name" == "rio" ]; then | |
sleep 2 | |
echo kubectl delete service -n kube-system traefik | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like you might need to publish ports?