Skip to content

Instantly share code, notes, and snippets.

@abdennour
Last active July 10, 2020 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdennour/4df1d77ad59a265d11ee237b97cb87ca to your computer and use it in GitHub Desktop.
Save abdennour/4df1d77ad59a265d11ee237b97cb87ca to your computer and use it in GitHub Desktop.
Run Cluster Command in one Command - kind
#!/bin/bash
kind_version=${1:-"v0.8.1"}
kind_bin_path=/usr/local/bin/kind
if [ ! -f ${kind_bin_path} ]; then
# curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${kind_version}/kind-$(uname)-amd64
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/${kind_version}/kind-$(uname)-amd64"
chmod +x ./kind
sudo mv ./kind ${kind_bin_path}
fi
cat <<EOF | kind create cluster --config -
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
EOF
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment