Tags: aws, cost


By default Kublr creates all master and worker instance groups using regular AWS on-demand instances and autoscaling groups with launch templates with a single instance type specified in the cluster specification.


At the same time, Kublr allows customizing instance group configuration to implement complex or extended use-cases.


The following cluster specification snippet shows an example of such customization with a node group using spot instances and mixed instance policy (the example shows master group customization, but any worker groups can be customized in the same manner):

spec:
  master:
    locations:
      - aws:
          # the main instance type
          instanceType: t3.medium

          # group type "asg-mip" means that Kublr will create an ASG with
          # a launch template and a mixed instance policy
          groupType: asg-mip

          # cloud formation mixed instance type section customizations
          mixedInstancesPolicyCloudFormationExtras:
            InstancesDistribution:
              # on-demand percentage set to 0 means that only spot
              # instances will be used
              OnDemandPercentageAboveBaseCapacity: 0
            LaunchTemplate:
              # other instance types to be used if the main
              # one is unavailable
              Overrides:
                - InstanceType: t3.medium
                - InstanceType: t2.medium


The following example shows launch template customization to use spot instances without mixed instance type:

spec:
  master:
    locations:
      - aws:
          # the main instance type
          instanceType: t3.medium

          # group type "asg-lt" means that Kublr will create an ASG with
          # a launch template (no mixed instance policy)
          groupType: asg-lt

          # launch template customization - use spot instances
          launchTemplateDataCloudFormationExtras:
            InstanceMarketOptions:
              MarketType: spot
              SpotOptions:
                # this is required as the spot instances are started as a part
                # of an auto-scaling group
                SpotInstanceType: one-time