Capturing some notes on how I setup my EKS cluster, as it took several attempts 😂 😳
I created a brand new AWS account, since I kept bumping up against limits when using the existing GitHub / Professional Services AWS. I made a careful note of:
- My AWS account id
- My Access Key ID
- My Secret Access Key
Despite what the AWS docs say, I used my root credentials throughout this demo, just to save time.
I followed the steps from this guide to setup aws
, eksctl
, kubectl
, and aws-iam-authenticator
locally:
pip install awscli --upgrade --user
# Install eksctl
brew tap weaveworks/tap
brew install weaveworks/tap/eksctl
eksctl version
# [ℹ] version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.3.1"}
It's already done for us on macOS (thanks homebrew 🙇):
which kubectl
# /usr/local/bin/kubectl
which aws-iam-authenticator
# /Users/swinton/go/bin/aws-iam-authenticator
Despite what this page says, I just did:
eksctl create cluster
I had to wait for my AWS account to be approved before this would work. It seems the account has to be approved for each region separately, when it comes to EKS.
Eventually I was able to get an EKS cluster running in the us-east-2
region.
# When your cluster is ready, test that your kubectl configuration is correct
kubectl get svc
CLUSTER_NAME=fabulous-monster-1565378541 # this was generated from the above eksctl create cluster command
AWS_DEFAULT_REGION=us-east-2
aws eks update-kubeconfig --name $CLUSTER_NAME --region $AWS_DEFAULT_REGION
This generates a ~/.kube/config
file, I then base64-encoded the contents of this file and saved it as a secret, KUBE_CONFIG_DATA
, in my @bbq-beets repo.
cat ~/.kube/config | base64 | pbcopy
For the demo to work, it's also necessary to create an ECR registry, in the same AWS region as the EKS cluster (us-east-2
in my case). I did this directly via the AWS console:
I then updated the kube config.yml
to match this ECR registry URI.
The following secrets are also required:
AWS_ACCOUNT_ID
: My AWS account idAWS_ACCESS_KEY_ID
: My Access Key ID for my root account, which isn't the ideal, but it worksAWS_SECRET_ACCESS_KEY
: My Secret Access Key for my root account, which isn't the ideal, but it worksAWS_ECR_PASSWORD
: The password for ECR, obtained viaaws ecr get-login --region $AWS_REGION --no-include-email
KUBE_CONFIG_DATA
: From the above,cat ~/.kube/config | base64 | pbcopy