OnDemandPercentageAboveBaseCapacity is set to 0 so all the additional instances will be launched as Spot Instances.OnDemandBaseCapacity is set to 2, meaning the first two EC2 instances launched by EC2 AutoScaling will be on-demand.This is particularly useful if you have Reserved Instances or Savings Plans for your baseline capacity, so Auto Scaling launches the instance type matching your reservations. The prioritized allocation strategy for on-demand instances makes AutoScaling try to launch the first instance type of your list and skip to the next instance type if for any reason it’s unable to launch it (e.g.Then, the InstancesDistribution configuration block determines how EC2 Auto Scaling picks the instance types to use, while at the same time it keeps a balanced number of EC2 instances per Availability Zone. That would give you the ability to provision Spot capacity from 18 different capacity pools. To adhere to best practices and maximize your chances of launching your target Spot capacity, configure a minimum of 6 different instance types across 3 Availability Zones). You can use the EC2 Instance Types console or the ec2-instance-selector CLI tool to find suitable instance types. As Spot instances are spare EC2 capacity, your workloads should be flexible to run on multiple instance types and multiple availability zones hence leveraging multiple spot capacity pools and making the most out of the available spare capacity. The Overrides configuration block provides EC2 AutoScaling the list of instance types your workload can run on. To learn more about the Capacity Relabancing feature, take a look at the docs. You will also notice that the CapacityRebalance parameter is set to true, which will proactively attempt to replace Spot Instances at elevated risk of interruption. Take a look at our docs to review how InstancesDistribution and allocation strategies work. Pay special attention at the Overrides and the InstancesDistribution. Open asg.json on the Cloud9 editor and review the configuration. You can find more information on the Auto Scaling documentation. Amazon EC2 Auto Scaling is well suited both to applications that have stable demand patterns or that experience hourly, daily, or weekly variability in usage. You can also use Amazon EC2 Auto Scaling for dynamic scaling of EC2 instances in order to automatically increase the number of Amazon EC2 instances during demand spikes to maintain performance and decrease capacity during lulls to reduce costs. You can use Amazon EC2 Auto Scaling for fleet management of EC2 instances to help maintain the health and availability of your fleet and ensure that you are running your desired number of Amazon EC2 instances. Increasing resilience when using Spot InstancesĪmazon EC2 Auto Scaling helps you maintain application availability and allows you to dynamically scale your Amazon EC2 capacity up or down automatically according to conditions you define. Lab 4: Using containers backed by Spot instance in Auto Scaling Groups Lab 3: Externalise state data to add resiliency to Jenkins Lab 2: Deploy testing environments using Spot & Launch TemplatesĬode snippet: The Test Environment CloudFormation templateĬode snippet: The SpotCICDWorkshop_ManageTestEnvironment Lambda function Lab 1: Reduce the cost of builds using Amazon EC2 Spot Fleet (Optional) Running cost optimized and resilient Jenkins jobsĬreate an Amazon SageMaker Notebook InstanceĬonfiguring Libraries for Managed Spot Training
Test Autoscaling of Cluster and Application Spot Best Practices and Interruption HandlingĬonfigure Horizontal Pod Autoscaler (HPA)Ĭreate self managed node groups with Spot Instances Select Instance Types for DiversificationĬreate EKS managed node groups with Spot capacity What happens when you create your EKS clusterĮKS Architecture for Control plane and Worker node communication Using AWS Fargate Spot capacity providersĪdd Fargate capacity providers to ECS Cluster Using Spot Instances with Auto Scaling groups capacity providersĬreate On-Demand Auto Scaling Group and Capacity ProviderĬreate EC2 Spot Auto Scaling Group and Capacity Provider Setup AWS CLI and clone the workshop repo Launching an EC2 Spot Instance via the RunInstances API Launching EC2 Spot Instances via an EC2 Fleet Launching EC2 Spot Instances via Spot Fleet request Launching EC2 Spot Instances via EC2 Auto Scaling group