Skip to content

Deploying to EKS

Chant supports cross-lexicon projects where AWS infrastructure and Kubernetes workloads live in the same src/ directory. The AWS lexicon produces a CloudFormation template; the K8s lexicon produces kubectl-ready YAML.

┌─────────────────────────────────────┐
│ AWS Lexicon (CloudFormation) │
│ ┌──────────┐ ┌──────────────┐ │
│ │ VPC/Nets │ │ EKS Cluster │ │
│ └──────────┘ └──────┬───────┘ │
│ ┌──────────┐ │ │
│ │ IAM Roles│ ←── OIDC Provider │
│ └────┬─────┘ │
│ ┌────┴─────────────────────┐ │
│ │ Add-ons: vpc-cni, ebs, │ │
│ │ coredns, kube-proxy │ │
│ └──────────────────────────┘ │
└───────┼─────────────────────────────┘
│ ARNs flow down via .env
┌───────▼─────────────────────────────┐
│ K8s Lexicon (kubectl apply) │
│ ┌────────────┐ ┌──────────────┐ │
│ │ Namespace │ │ IRSA SA │ │
│ │ + Quotas │ │ (role-arn) │ │
│ └────────────┘ └──────────────┘ │
│ ┌────────────┐ ┌──────────────┐ │
│ │ Autoscaled │ │ ALB Ingress │ │
│ │ Service │ │ (cert-arn) │ │
│ └────────────┘ └──────────────┘ │
│ ┌────────────┐ ┌──────────────┐ │
│ │ EBS Storage│ │ FluentBit │ │
│ │ Class │ │ + ADOT │ │
│ └────────────┘ └──────────────┘ │
└─────────────────────────────────────┘

CloudFormation stack outputs map to K8s composite props via .env:

CF OutputK8s Composite Prop
appRoleArnIrsaServiceAccount({ iamRoleArn })
externalDnsRoleArnExternalDnsAgent({ iamRoleArn })
fluentBitRoleArnFluentBitAgent({ iamRoleArn })
adotRoleArnAdotCollector({ iamRoleArn })
ACM cert ARNAlbIngress({ certificateArn })
Cluster nameFluentBitAgent({ clusterName }), AdotCollector({ clusterName })

Values flow through .envconfig.ts → K8s source files. npm run load-outputs refreshes .env after any infra deploy.

The K8s lexicon provides EKS-specific composites for the workload side:

  • IrsaServiceAccount — ServiceAccount with IAM role annotation for IRSA
  • AlbIngress — Ingress with ALB Controller annotations, SSL redirect, shared ALB groups
  • EbsStorageClass — gp3 encrypted StorageClass via EBS CSI
  • EfsStorageClass — ReadWriteMany StorageClass via EFS CSI
  • FluentBitAgent — DaemonSet for CloudWatch logging
  • ExternalDnsAgent — Route53 DNS record management
  • AdotCollector — CloudWatch/X-Ray metrics and traces

See the EKS Composites reference for full API details.

Terminal window
npm run build # Build CF template + K8s manifests
npm run deploy-infra # Deploy CloudFormation stack
npm run configure-kubectl # Set up kubeconfig
npm run load-outputs # Write real ARNs to .env
npm run build:k8s # Rebuild K8s with real values
npm run apply # kubectl apply