AWS EKS Anywhere — Local Kubernetes On Premise

Source: AWS

Prerequisites

  1. Morning cup of Coffee and a dose of Super excitement
  2. Docker Version 20 locally installed ( I have Docker desktop running on my Mac OS running Big Sur -Intel Chipset with 8 GB of RAM).
  3. Latest version of EKSCTL (version 0.66) or newer. If not installed locally run the following command on your Mac command line
curl "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" \
--silent --location \
| tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin/
export EKSA_RELEASE="0.5.0" OS="$(uname -s | tr A-Z a-z)"
curl "https://anywhere-assets.eks.amazonaws.com/releases/eks-a/1/artifacts/eks-a/v${EKSA_RELEASE}/${OS}/eksctl-anywhere-v${EKSA_RELEASE}-${OS}-amd64.tar.gz" \
--silent --location \
| tar xz ./eksctl-anywhere
sudo mv ./eksctl-anywhere /usr/local/bin/

Creating your first EKS Cluster

  1. Run the following command to generate your cluster YAML.
eksctl anywhere generate clusterconfig myfirstekscluster --provider docker > myfirstekscluster.yaml
apiVersion: anywhere.eks.amazonaws.com/v1alpha1
kind: Cluster
metadata:
name: myfirstekscluster
spec:
clusterNetwork:
cni: cilium
pods:
cidrBlocks:
- 192.168.0.0/16
services:
cidrBlocks:
- 10.96.0.0/12
controlPlaneConfiguration:
count: 1
datacenterRef:
kind: DockerDatacenterConfig
name: myfirstekscluster
externalEtcdConfiguration:
count: 1
kubernetesVersion: "1.21"
workerNodeGroupConfigurations:
- count: 1

---
apiVersion: anywhere.eks.amazonaws.com/v1alpha1
kind: DockerDatacenterConfig
metadata:
name: myfirstekscluster
spec: {}

---
eksctl anywhere create cluster -f myfirstekscluster.yaml
8 GB MacBook sucks big time with Docker Desktop!!
Snapshot of my RAM during EKS Anywhere cluster creation.
eksctl anywhere create cluster -f myfirstekscluster.yaml
Performing setup and validations
Warning: The docker infrastructure provider is meant for local development and testing only
✅ Docker Provider setup is valid
Creating new bootstrap cluster
Installing cluster-api providers on bootstrap cluster
Provider specific setup
Creating new workload cluster
Installing networking on workload cluster
Installing storage class on workload cluster
Installing cluster-api providers on workload cluster
Moving cluster management from bootstrap to workload cluster
Installing EKS-A custom components (CRD and controller) on workload cluster
Creating EKS-A CRDs instances on workload cluster
Installing AddonManager and GitOps Toolkit on workload cluster
GitOps field not specified, bootstrap flux skipped
Writing cluster config file
Deleting bootstrap cluster
🎉 Cluster created!
export KUBECONFIG=myfirstekscluster-eks-a-cluster.kubeconfig
$ kubectl get ns
NAME STATUS AGE
capd-system Active 8m3s
capi-kubeadm-bootstrap-system Active 9m30s
capi-kubeadm-control-plane-system Active 8m32s
capi-system Active 9m46s
capi-webhook-system Active 9m53s
cert-manager Active 12m
default Active 18m
eksa-system Active 5m54s
etcdadm-bootstrap-provider-system Active 9m15s
etcdadm-controller-system Active 8m57s
kube-node-lease Active 18m
kube-public Active 18m
kube-system Active 18m
kubectl apply -f "https://anywhere.eks.amazonaws.com/manifests/hello-eks-a.yaml"
deployment.apps/hello-eks-a created
service/hello-eks-a created
kubectl logs -l app=hello-eks-a
2021/09/09 17:25:48 [notice] 1#1: using the "epoll" event method
2021/09/09 17:25:48 [notice] 1#1: nginx/1.21.1
2021/09/09 17:25:48 [notice] 1#1: built by gcc 10.3.1 20210424 (Alpine 10.3.1_git20210424)
2021/09/09 17:25:48 [notice] 1#1: OS: Linux 5.10.47-linuxkit
2021/09/09 17:25:48 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/09/09 17:25:48 [notice] 1#1: start worker processes
2021/09/09 17:25:48 [notice] 1#1: start worker process 37
2021/09/09 17:25:48 [notice] 1#1: start worker process 38
2021/09/09 17:25:48 [notice] 1#1: start worker process 39
2021/09/09 17:25:48 [notice] 1#1: start worker process 40
$ kubectl port-forward deploy/hello-eks-a 8000:80
Forwarding from 127.0.0.1:8000 -> 80
Forwarding from [::1]:8000 -> 80

Roadblocks Encountered and Resolutions

  1. cluster-api failures most likely due to network issues. I encountered Cluster creation issues outlined below while running the cluster creation with VPN ON.
Installing cluster-api providers on workload cluster
Error: failed to create cluster: error waiting for capi-kubeadm-bootstrap-controller-manager in namespace capi-kubeadm-bootstrap-system: error executing wait: error: the server doesn’t have a resource type “deployments”
 eksctl anywhere delete cluster ${CLUSTER_NAME}
Error: clusterconfig file dev/dev-eks-a-cluster.yaml for cluster: dev not found, please provide the clusterconfig path manually using -f <config-file>
eksctl anywhere delete cluster -f dev-cluster.yaml
eksctl anywhere delete cluster -f dev-cluster.yaml
Performing provider setup and validations
Creating management cluster
Installing cluster-api providers on management cluster
Moving cluster management from workload cluster
Deleting workload cluster
Error: failed to delete cluster: error deleting cluster dev-cluster apply: Error from server (NotFound): clusters.cluster.x-k8s.io "dev-cluster" not found

--

--

--

Amazonian, MBA, AI/ML, Blockchain, Cloud and Electronic Music Enthusiast — Nerd by profession, Hacker at Heart.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What programming language should you learn (next)?

Experiment: Amazon’s Layout Clone

Challenge yourself

Gitlab CI: Build & push Docker image to AWS ECR, Deploy to EKS.

Announcing package support for DartPad

#Natgas is holding up with each surge higher. #NG_F #Natty https://t.co/8K86voxvrW

Tcpdump at the Linux command line

The new way of defining eloquent accessors and mutators in Laravel 9.x

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sankar Panneerselvam

Sankar Panneerselvam

Amazonian, MBA, AI/ML, Blockchain, Cloud and Electronic Music Enthusiast — Nerd by profession, Hacker at Heart.

More from Medium

How to use a private AWS Elastic Container Registry (ECR) with an external Kubernetes Cluster or…

Managing and Troubleshooting AWS EKS Access

Enabling IAM users/roles Access on Amazon EKS cluster

Using Amazon’s Kubernetes Distribution Everywhere with Amazon EKS Distro