DEV Community

Arun Kumar for AWS Community Builders

Posted on • Edited on

1 1

AWS EKS — Quick Setup

Steps to provision EKS cluster in AWS

  • Create 5 VPC Endpoints, please note for FargateOnly cluster we also need to add one extra VPC endpoint which is for “sts”
com.amazonaws.region.ecr.api
com.amazonaws.region.ecr.dkr
com.amazonaws.region.ec2
com.amazonaws.region.s3
com.amazonaws.region.sts
Enter fullscreen mode Exit fullscreen mode
  • Create the EKS Fargate Only cluster using the 3 PrivateOnly subnets with the command below:
$ eksctl create cluster \
 --name fargateprod \
 --region us-east-1 \
 --vpc-private-subnets=subnet-089c8482f000f3qwe,subnet-001022620f283121cb,subnet-0387722f71210b1f4a \
 --fargate
Enter fullscreen mode Exit fullscreen mode

Please make sure to replace the three subnets in the command above with the subnets of your VPC, which can be checked in the output section of the Stack which was created from step1

  • Once Cluster is created, update the Private API server endpoint for this cluster to “true” and make sure it has a Fargate profile for “default” and “kube-system” namespaces.

  • After following the above steps the coredns pods should come to “Ready” state and you will be able to see the nodes as well.

Cli

# Create cluster
export CLUSTER=my-eks-ak
eksctl create cluster --name=$CLUSTER \
  --vpc-private-subnets=subnet-b14e21f7,subnet-76f21611,subnet-a8f814e1 \
  --region ap-southeast-1 --fargate

# check coredns
kubectl get pods -n kube-system

# enable private endpoint access
eksctl utils update-cluster-endpoints --cluster $CLUSTER --private-access=true --approve 

# delete coredns pods to retart it
kubectl delete pod <pending coredns pod> -n kube-system

# check coredns
kubectl get pods -n kube-system
Enter fullscreen mode Exit fullscreen mode

References
[https://github.com/tohwsw/aws-eks-workshop-fargate]
[https://github.com/tohwsw/aws-eks-workshop-fargate]
[https://aws.amazon.com/blogs/containers/de-mystifying-cluster-networking-for-amazon-eks-worker-nodes/]
[https://eksctl.io/usage/vpc-networking/]

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay