I've set up a CDK app where I'm using separate stacks for my VPC, RDS/S3 persistence, an EKS cluster, and an API stack. I wanted to keep everything organized so that each application gets its own stack for Kubernetes deployments. The idea was to be able to create or delete these applications without impacting the rest of my resources. However, when I deploy my EKS stack, it ends up deploying Kubernetes manifests defined in my other, not-yet-deployed stacks. I suspect this might be due to CloudFormation's inability to directly handle internal Kubernetes items. Can anyone clarify why this happens and how I can manage this in CDK effectively?
2 Answers
Make sure to double-check the deployment command you're using. Deploying with `cdk deploy MyStackName` will deploy that specific stack and any of its dependencies. If your stacks are tightly coupled, even though they're separate, it can lead to manifests from one stack being triggered during another's deployment. You might need to adjust the stack dependencies to achieve the separation you're aiming for.
It sounds like your CDK setup might be mixing dependencies across stacks. When you declare manifests with `cluster.addManifest(...)`, they can inadvertently get attached to the deployment of the EKS stack. To keep things more isolated, consider setting up a separate way to handle those resources, perhaps with Stack Outputs. This could help ensure that deploying the EKS stack doesn’t trigger the others to deploy prematurely. Plus, if you consolidate your Kubernetes resources into a single or tightly controlled stack, you'll have better visibility and control over what's being deployed when.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically