Installing eksctl

All the books / videos I’ve been studying on Kubernetes have been talking about local instances or GCP/Azure… But I’m going to be a little stubborn and run all of my labs in AWS because AWS is the 10,000 Pound Gorilla and I want to practice in AWS more. =)

(And in concept, Kubernetes should be the same regardless of the public/private cloud resources used since it’s another level of abstraction.)

So today we’re going to install eksctl and setup a quick demo Kubernetes cluster in AWS…

This presumes that you already have the AWS CLI installed.

These instructions were written for a CentOS 7.x Desktop.

1.) Install kubectl

# yum install kubectl

Detailed instructions can be found on the Kubernetes Documentation site.

Install and Set Up kubectl

(Don’t forget to add the Kubernetes repo first if you don’t already have it.)

# cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF

2.) Download eksctl from the weaveworks GitHub repo and move it into the /usr/local/bin directory.

# curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp

# mv /tmp/eksctl /usr/local/bin

Detailed instructions can be found on the AWS Documentation site.

Getting Started with eksctl

3.) Create a Kubernetes Cluster

$ eksctl create cluster --node-type t2.micro

We’re specifying the node-type as being t2.micro so that we can stay mostly in the free tier for this exercise. The default is for eksctl to spin up a cluster using m5.large EC2 instances.

The eksctl readme page has details on the other defaults associated with the eksctl create cluster command.

After we’re done, we’ll also delete the cluster so you don’t run up AWS charges. =)

$ eksctl delete cluster --region={Region} --name={Cluster Name}

Leave a Reply

Your email address will not be published. Required fields are marked *