Skip to content

Instantly share code, notes, and snippets.

Created December 26, 2020 22:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
export KIND_CLUSTER_NAME=$(whoami)
export INSTALL_K3S_VERSION=v1.19.5+k3s2
export INSTALL_K3S_EXEC="--node-label cluster=${KIND_CLUSTER_NAME} --kubelet-arg=port=10260"
export K3S_TOKEN=K100eb593c7b4dcba3df04ffc638c7133bf66677599e3c5be1daca4bb7a7dedb27d::server:0b3300e83314273d0a4ffb08d4cb0144
export K3S_URL=
cat <<EOF | kind create cluster --config=-
kind: Cluster
- role: control-plane
- role: worker
- role: worker
- role: worker
for i in $(kind get nodes); # works cause KIND_CLUSTER_NAME is already defined
docker exec -ti --env INSTALL_K3S_VERSION --env INSTALL_K3S_EXEC --env K3S_URL --env K3S_TOKEN $i bash -c "kubeadm reset -f && curl -sfL | sh -s - ${INSTALL_K3S_EXEC}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment