Skip to content

Instantly share code, notes, and snippets.

@attawayinc
Forked from ams0/install-k3d.sh
Created November 25, 2020 21:46
Show Gist options
  • Save attawayinc/f2c21984282237f62e94cc26bb1490eb to your computer and use it in GitHub Desktop.
Save attawayinc/f2c21984282237f62e94cc26bb1490eb to your computer and use it in GitHub Desktop.
#!/bin/bash
#save as install-k3d.sh
#az vm create -g k3s --image UbuntuLTS --admin-username ubuntu --ssh-key-values ~/.ssh/id_rsa.pub -n k3s --custom-data install-k3d.sh
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1002 --access Allow --protocol Tcp --destination-port-ranges 443 -n https
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1001 --access Allow --protocol Tcp --destination-port-ranges 80 -n http
curl https://get.docker.com/ | sh
sudo usermod -aG docker ubuntu
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
k3d cluster create k3d -p "80:80@loadbalancer" -p "443:443@loadbalancer" --agents 2
su - ubuntu -c 'k3d kubeconfig merge k3d --switch-context -o /home/ubuntu/.kube/config'
wget "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" -O /usr/local/bin/kubectl
chmod +x /usr/local/bin/kubectl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment