AWS and Kubernetes can be intimidating at times, and setting up K8s clusters manually can lead to headaches if not properly configured. Luckily, eksctl allows you to create your own EKS cluster in a matter of minutes without headache or hassle. In this guide, we will install the necessary command line tools and create a Kubernetes cluster on AWS
Kubernetes is open-source software that allows you to manage and deploy any number of containers. For a simple explanation of containers and Kubernetes clusters, see the Illustrated Children's Guide to Kubernetes.
First, we need to install Amazon's command-line tool that allows us to set up and configure AWS services from the command line. These install directions come from AWS Documentation.
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "aws.zip"
Download and run the .msi installer for AWS CLI here
Download and run the .pkg installer for AWS CLI here
Once you have
aws installed, you will need to configure it to communicate with your aws account. In order to do that, you will need to log into your aws management console, and under IAM settings you will need to get an access key and secret key.
Once you have that, run the command
and respond to each of the the prompts appropriately.
kubectl is Kubernetes' command-line tool that allows you to manage your Kubernetes clusters. Kubernetes documentation has a pretty good overview of the things that you can do using kubectl here. For more options for installing kubectl, refer to the documentation here
sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2 curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
yum install -y kubectl
To install kubectl using the chocolatey package manager:
choco install kubernetes-cli
To install kubectl using the homebrew package manager
brew install kubectl
eksctl is a CLI for creating and managing Amazon EKS clusters.
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
To install eksctl using the chocolatey package manager:
choco install eksctl
To install eksctl using the homebrew package manager
brew tap weaveworks/tap
brew install weaveworks/tap/eksctl
At this point, we are ready to spin up our AWS Cluster
eksctl create cluster
Will create a brand new cluster with a random name and two m5.large worker nodes.