Techniques for Production-Grade CDKs: Automation of VPCs, EKS, and Karpenter

By Juan Carlos Martinez Carrillo

Elevator Pitch

This talk demos a proven pattern for CDK-based infra as code. Learn to create clear, scalable CFN stacks following 12-factor principles, easily separated by environment in CI/CD. See real-world examples of new Kubernetes API access entries and Karpenter, addressing the lack of practical resources.

Description

This talk presents a CDK implementation pattern inspired by “12 factor app”, focusing on configuration separation and stack modularization.

We’ll address techniques to reduce the complexity of monolithic stacks, applying principles of separation of concerns and allowing environment differentiation through command-line arguments. This facilitates the integration of CDK into common CI/CD environments such as GitHub Actions, GitLab CI/CD, or Harness.

We’ll use the deployment of a VPC, an EKS cluster, and Karpenter, using CDKs to demonstrate the project pattern and structure, covering:

  • VPC: Analysis of a 3-subnet architecture and its implementation in CDK.
  • CDKs How to pass contexts to Sub Stacks, such as the VPC.
  • EKS: New authentication methods with CDK:
    • Context transfer between VPC and EKS stacks.
    • Migration from ConfigMap to the Access Entries API.
    • Implementation of Pod Identities for authenticating kubernetes resources to AWS IAM.
    • Karpenter: Advantages in EKS autoscaling, impact on costs and scaling speed.

Notes

Technical requirements: 1. Ability to project code samples 2. Stable internet connection for live demos

Why this talk matters: 1. Addresses common pain points in scaling infrastructure-as-code 2. Provides a proven pattern I’ve used for production deployments 3. Fills gaps in current resources, where most CDK courses and interactive samples are too basic.

Speaker qualifications: 1. Hands-on experience with AWS services in production environments 2. I am passionate about sharing knowledge and teaching; I have a course on KodeKloud https://learn.kodekloud.com/courses/advanced-bash-scripting (training platform for DevOps Engineers) 3. Track record of simplifying complex infrastructure setups 4. Been a speaker on Kubernetes Community Days in Mexico 5. Senior DevOps Engineer with 10 years of experience