POSThttps://api.spotinst.io/ocean/aws/k8s/cluster/autoScalingGroup/import?accountId={ACCOUNT_ID}

Create an Ocean configuration according to an AWS ASG  configuration.

URL Parameters

Parameter Type Description
autoScalingGroupName * String

The ASG name

region * String

Region name of the ASG

Example: us-east-1
ACCOUNT_ID * String

The Spotinst accountId associated with your token.

Example: act-123abc
Request

Headers
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "cluster": {
	"instanceTypes": [
		"c2.large",
		"t2.micro"
		]
	}
}
Attribute Type Description
cluster Object

cluster.instanceTypes Array<String>

Set instance types whitelist. this list would set Ocean on which instance types to utilize.

Response - 200

Body
Copied!
Downloaded!
{
   "cluster":{
      "name":"oceanName",
      "controllerClusterId":"ocean.k8s",
      "region":"us-east-1",
      "autoScaler":{
         "isEnabled":true,
         "cooldown":180,
         "resourceLimits":{
            "maxMemoryGib":1500,
            "maxVCpu":750
         },
         "down":{
            "evaluationPeriods":3,
            "maxScaleDownPercentage":60
         },
         "headroom":{
            "cpuPerUnit":2000,
            "memoryPerUnit":0,
            "gpuPerUnit":1,
            "numOfUnits":4
         },
         "isAutoConfig":false
      },
      "capacity":{
         "minimum":0,
         "maximum":1000,
         "target":1
      },
      "strategy":{
         "fallbackToOd":true,
         "utilizeReservedInstances":true,
         "drainingTimeout":60
      },
      "scheduling":{

      },
      "security":{
         "containerImage":{
            "approvedImages":[
               ".ecr..amazonaws.com/",
               "docker."
            ]
         }
      },
      "compute":{
         "subnetIds":[
            "subnet-4c1d1538",
            "subnet-2791bb61"
         ],
         "instanceTypes":{
            "whitelist":[
               "c2.large",
               "t2.micro"
            ]
         },
         "launchSpecification":{
            "securityGroupIds":[
               "sg-c3d914b0"
            ],
            "iamInstanceProfile":{
               "arn":"arn1234"
            },
            "keyPair":"spotinst-labs-oregon",
            "tags":[
               {
                  "tagKey":"creator",
                  "tagValue":"testing"
               },
               {
                  "tagKey":"k8s.io/role/node",
                  "tagValue":"1"
               }
            ],
            "loadBalancers":[
               {
                  "name":"MyTargetGroup",
                  "arn":"arn:aws:elasticloadbalancing:us-west-2:922761411234:targetgroup",
                  "type":"TARGET_GROUP"
               },
               {
                  "name":"MyClassicLB",
                  "type":"CLASSIC"
               }
            ],
            "associatePublicIpAddress":true,
            "monitoring":false,
            "ebsOptimized":false,
            "rootVolumeSize":73
         }
      }
   }
}