Last active
October 8, 2020 03:55
-
-
Save p-le/dfc791a2f131797668a25a56d3e3b993 to your computer and use it in GitHub Desktop.
Vagrantfile for AWS EKS
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# https://app.vagrantup.com/hashicorp/boxes/bionic64 | |
config.vm.box = "hashicorp/bionic64" | |
config.vm.box_check_update = true | |
# Create a private network, which allows host-only access to the machine | |
# using a specific IP. | |
config.vm.network "private_network", ip: "192.168.33.15" | |
# Share an additional folder to the guest VM | |
# config.vm.synced_folder "./shared", "/vagrant_data" | |
# Customize the disk size on the guest VM: (using vagrant-disksize plugin) | |
# config.disksize.size = '50GB' | |
# Customize hostname of the guestVM | |
config.vm.hostname = "kubernetes-session" | |
config.vm.provider "virtualbox" do |vb| | |
# Customize the amount of memory on the guest VM: | |
vb.memory = "1024" | |
end | |
# Enable provisioning guest VM with shell script | |
config.vm.provision "shell", inline: <<-SHELL | |
apt-get update -y | |
apt-get install -y unzip | |
# Install AWS CLI | |
curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip | |
unzip awscliv2.zip | |
./aws/install | |
# Install eksctl | |
url --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp | |
mv /tmp/eksctl /usr/local/bin | |
# Install kubectl | |
curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.9/2020-08-04/bin/linux/amd64/kubectl | |
chmod +x ./kubectl | |
mv ./kubectl /usr/local/bin | |
# Verify versions | |
aws --version | |
eksctl version | |
kubectl version --short --client | |
echo ">>> PLEASE RUN aws configure TO SETUP AWSCLI <<<" | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment