Building an Amazon EKS Cluster Preconfigured to Run High Traffic Microservices
Deploy a preconfigured Amazon EKS cluster optimized for high-demand microservice applications using an eksctl "quickstart" template.
About | |
---|---|
✅ AWS experience | 200 - Intermediate |
⏱ Time to complete | 30 minutes |
🧩 Prerequisites | - AWS Account |
📢 Feedback | Any feedback, issues, or just a 👍 / 👎 ? |
⏰ Last Updated | 2023-08-29 |
- Install the latest version of kubectl. To check your version, run:
kubectl version --short
. - Install the latest version of eksctl. To check your version, run:
eksctl info
.
eksctl
cluster template that follows, you'll build a robust, scalable, and secure Amazon EKS cluster with managed node groups. This template not only enables application workloads but also fortifies the cluster with an additional layer of security, fully aligned with best practices for production environments. It configures the following components:- Autoscaling: Managed node groups use an
m5.large
instance type, providing a balance of resources. With a minimum size of "2" and a maximum size of "5", node groups can dynamically scale. The volume size is set to "100", ensuring ample capacity, and required subnet tags allow the Kubernetes Cluster Autoscaler (CA) to dynamically scale your cluster. - Authentication: Necessary EKS Pod Identities mappings to enable communication between Kubernetes pods and AWS services. This includes the AWS Load Balancer Controller (LBC) used to expose applications, Amazon EFS CSI Driver for persistent data storage, Kubernetes External DNS to automatically manage DNS records, and Cert Manager to streamline management of SSL/TLS certificates. Additionally, an OpenID Connect (OIDC) endpoint enables seamless and secure communication.
- Add-ons: Latest versions of the following add-ons, including "vpc-cni" to enable the Amazon VPC Container Network Interface, "coredns" to facilitate DNS resolution, "kube-proxy" to maintain network rules on each Amazon EC2 node, and the EBS CSI Driver Add-On.
- Public/Private Networking: Managed node groups utilize private networking and a NAT gateway to bolster security by limiting direct internet access. The AWS Load Balancer Controller (LBC) manages and securely distributes all incoming web traffic to private subnets.
- Monitoring: An Amazon CloudWatch IAM policy is attached to the EKS Pod Identity, aiding optional components like CloudWatch Container Insights to collect and summarize metrics and logs.
Note that if you're still within your initial 12-month AWS Free Tier period, certain Amazon EC2 instances for managed node groups and additional AWS services may not be included in the Free Tier, and charges may apply based on your usage.
cluster-config.yaml
file, you'll define the settings for IAM roles, scalable resources, private networking, and monitoring. These configurations are essential for ensuring that the cluster is robust, scalable, and secure, with optimized performance for dynamic scalability and data persistence.- Create a
cluster-config.yaml
file and paste the following contents into it. Replace theregion
with your preferred region.
- Create the EKS cluster using the
cluster-config.yaml
.
Ready
state with the following command:Feature | EKS Auto Mode | Standard Mode |
---|---|---|
Node Group Management | Automatic scaling and updates | Manual configuration required |
Security Compliance | Pre-configured security policies and controls | Manual security configuration |
Load balancing | Pre-integrated with with Application Load Balancer | Manual setup required |
Production Readiness | Immediate - preconfigured best practices | Requires manual implementation of best practices |
Cost Optimization | Built-in cost optimization | Separate cost management setup needed |
- Create a
cluster-config.yaml
file and paste the following contents into it. Replace theregion
with your preferred region.
- Create the EKS cluster using the
cluster-config.yaml
.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.