Amazon SageMaker AI Spaces is an add-on for Amazon EKS that enables data scientists to run interactive development environments such as JupyterLab and Code Editor directly on the cluster. This eliminates the need to move to standalone JupyterHub deployments or local laptops, which often lack GPU access, shared storage, and IAM roles required for pipeline operations. According to the source, launching a fully configured Space with the add-on takes about 5 minutes, compared to 3–5 days for a standalone JupyterHub environment. This integration streamlines AI workflows by keeping GPU nodes busy between jobs, potentially improving GPU utilization by up to 30 percent compared to a dedicated notebook fleet. It also reduces the cost of maintaining an always-on GPU environment, which can exceed thousands of dollars monthly. The solution runs on a single EKS cluster with three layers: network and access, cluster routing, and compute and storage. These layers ensure secure, scalable, and efficient access to interactive IDEs while leveraging existing AWS infrastructure. The setup process involves configuring the EKS cluster, installing necessary add-ons, and setting up IAM roles and security policies to support the Spaces add-on. It also includes steps to tag subnets for the AWS Load Balancer Controller to function correctly, ensuring the ALB is placed on the right subnets. The process requires an AWS account with specific tools and permissions, and it creates resources that incur AWS charges. A cleanup section is recommended to remove these resources after the setup is complete. The add-on version must be 0.1.4 or later to support the full functionality described in the solution. The overall goal is to enhance the efficiency and accessibility of AI workflows by integrating interactive development environments directly into the EKS cluster environment.

The solution architecture includes Amazon Route 53 resolving a wildcard domain to an internet-facing Application Load Balancer (ALB) with TLS from AWS Certificate Manager (ACM). For VS Code, AWS Systems Manager tunnels directly to the Space pod. The AWS Load Balancer Controller provisions the ALB, and Traefik routes by hostname. Auth middleware validates tokens using AWS Key Management Service (AWS KMS) for JSON Web Token (JWT) encryption. Space pods run on private-subnet workers, with Amazon Elastic Block Store (Amazon EBS) CSI driver providing persistent volumes and Amazon Elastic File System (Amazon EFS) or Amazon FSx handling shared or high-throughput storage. EKS Pod Identity grants pods scoped IAM roles, ensuring secure and efficient resource access. The setup involves creating an EKS cluster with specific configurations, including disabling Auto Mode, using a VPC with public and private subnets, and adding necessary add-ons. The process also requires tagging subnets for the AWS Load Balancer Controller to function correctly, ensuring the ALB is placed on the right subnets. The setup includes configuring kubectl, confirming add-on pods are healthy, and setting up External DNS with Route 53 permissions. It also involves creating an IAM role for External DNS and binding it through Pod Identity, ensuring secure and efficient DNS management. The AWS Load Balancer Controller provisions the ALB that fronts the Spaces environment, enabling secure and scalable access to interactive IDEs.

The setup process requires an AWS account with the AWS Command Line Interface (AWS CLI) 2.x or later, kubectl 1.30 or later, and Helm v3. A Route 53 public hosted zone for a domain the user owns is also needed, along with IAM permissions to create roles, policies, EKS add-ons, and other resources. The Spaces add-on must be version 0.1.4 or later to support the full functionality described in the solution. The process includes setting environment variables for the cluster name, region, and account ID, and creating a trust policy for Pod Identity. The walkthrough creates resources that incur AWS charges, including an internet-facing ALB, EBS volumes, and an EKS cluster. SSM advanced-instances tier adds about $0.00695/hr per Space pod. The cleanup section is recommended to remove these resources after the setup is complete. The overall goal is to enhance the efficiency and accessibility of AI workflows by integrating interactive development environments directly into the EKS cluster environment.

Source: awsml