Skip to content

feat: add NODE_TYPE, EKS_VERSION, CLUSTER_TAGS, USE_SPOT options to AWS EKS setup#349

Open
michaelraney wants to merge 1 commit intodocumentdb:mainfrom
michaelraney:feat/aws-observability-addon-migration
Open

feat: add NODE_TYPE, EKS_VERSION, CLUSTER_TAGS, USE_SPOT options to AWS EKS setup#349
michaelraney wants to merge 1 commit intodocumentdb:mainfrom
michaelraney:feat/aws-observability-addon-migration

Conversation

@michaelraney
Copy link
Copy Markdown

@michaelraney michaelraney commented Apr 20, 2026

Summary

Adds narrowly-scoped cost-optimization options to the AWS EKS playground, per reviewer feedback to keep documentdb-playground/aws-setup/ simple and DocumentDB-focused:

  • --node-type / NODE_TYPE env var — EC2 instance type (default: m7g.large, Graviton/ARM).
  • --eks-version / K8S_VERSION env var — Kubernetes/EKS version (default: 1.35).
  • --spot / USE_SPOT env var — opt-in Spot-backed managed nodes for dev/test cost reduction (~70%).
  • --tags / CLUSTER_TAGS env var — AWS cost allocation tags for Cost Explorer tracking.

Why

The EKS setup should be affordable by default and easy to attribute in Cost Explorer. These four knobs cover the straightforward options without introducing AWS-specific infrastructure the core team would need to maintain.

Scope split

The advanced work originally in this PR (S3 Gateway VPC endpoint, Amazon CloudWatch Observability add-on / Container Insights, EKS control-plane logging, log-group retention, CloudWatch-aware teardown and diagnostics) has been moved to a separate follow-up PR under documentdb-playground/contrib/telemetry-and-cost-optimized-eks/ so the core scripts stay simple, while users who want the full telemetry+cost-optimized variant can opt in.

Test plan

  • ./documentdb-playground/aws-setup/scripts/create-cluster.sh with defaults — cluster created on m7g.large with default tags applied.
  • ./documentdb-playground/aws-setup/scripts/create-cluster.sh --spot — Spot-backed nodes provisioned, warning banner shown.
  • ./documentdb-playground/aws-setup/scripts/create-cluster.sh --tags "project=myproj,team=platform" — custom tags present on AWS resources.
  • ./documentdb-playground/aws-setup/scripts/create-cluster.sh --eks-version 1.34 --node-type m5.large — overrides respected.
  • ./documentdb-playground/aws-setup/scripts/delete-cluster.sh — teardown completes cleanly (delete-cluster.sh is unchanged in this PR).

@michaelraney michaelraney force-pushed the feat/aws-observability-addon-migration branch 5 times, most recently from 3c33783 to a2888a5 Compare April 20, 2026 21:50
@michaelraney michaelraney changed the title feat: optimize AWS playground costs with spot, tags, and S3 endpoint feat: optimize AWS EKS deployment costs and improve observability Apr 20, 2026
@hossain-rayhan
Copy link
Copy Markdown
Collaborator

Hi @michaelraney,

Thanks for the contribution! Great to see someone improving the AWS EKS experience.

Quick thought on scope: we try to keep documentdb-playground simple and DocumentDB-focused. We also don't have deep AWS expertise on the team yet, so maintaining advanced configs long-term would be challenging.

Suggestion: Let's keep the straightforward options in this PR: NODE_TYPE, EKS_VERSION, CLUSTER_TAG, USE_SPOT.

For the advanced stuff (VPC endpoints, Container Insights, event filtering), would you mind splitting those into a separate PR under documentdb-playground/contrib/telemetry-and-cost-optimized-eks/? That way we can keep the core scripts simple while still making your advanced work available to folks who need it.

…WS EKS setup

Add cost-oriented defaults and controls to the AWS EKS playground:
- NODE_TYPE default bumped to m7g.large (Graviton/ARM) with --node-type override
- K8S_VERSION pinned to 1.35 with --eks-version override
- --spot opt-in for Spot-backed managed nodes (dev/test only)
- --tags (and CLUSTER_TAGS env var) for AWS cost allocation tracking

Scope is intentionally limited per reviewer feedback on PR documentdb#349; advanced
observability and VPC-endpoint work is delivered in a separate contrib PR.

Signed-off-by: michaelraney <raneymike83@gmail.com>
Made-with: Cursor
@michaelraney michaelraney force-pushed the feat/aws-observability-addon-migration branch from a2888a5 to 1d466c8 Compare April 22, 2026 14:06
@michaelraney michaelraney changed the title feat: optimize AWS EKS deployment costs and improve observability feat: add NODE_TYPE, EKS_VERSION, CLUSTER_TAGS, USE_SPOT options to AWS EKS setup Apr 22, 2026
@michaelraney
Copy link
Copy Markdown
Author

Thanks @hossain-rayhan — split done as suggested.

This PR is now narrowed to just the four straightforward options you called out: NODE_TYPE, EKS_VERSION (--eks-version), USE_SPOT (--spot), and CLUSTER_TAGS (--tags). delete-cluster.sh is unchanged from main in this PR. (Force-pushed the branch; original work is preserved locally under the aws-advanced-backup tag.)

The advanced CloudWatch observability and cost-optimization work (S3 Gateway VPC endpoint, EKS control-plane logging + retention, Amazon CloudWatch Observability add-on / Container Insights, CloudWatch-aware teardown and diagnostics, 2-AZ deployment, mongosh prereq, CloudFormation event diagnostics) moved to a new self-contained contrib variant: #352 (documentdb-playground/contrib/telemetry-and-cost-optimized-eks/). It ships as 7 logical commits — scaffold, cost/QoL, VPC endpoint, control-plane logging + retention, Container Insights, diagnostics, README — and uses a distinct default CLUSTER_NAME so it can run alongside the base setup.

NODE_TYPE="$2"
shift 2
;;
--eks-version|--k8s-version)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the eks-version and k8s-version same term internally for AWS customers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants