fbpx
POSThttps://api.spotinst.io/ocean/aws/ecs/cluster?accountId={ACCOUNT_ID}

URL Parameters

Parameter Type Description
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": {
    "clusterName": "oceanEcs-FirstOfHisName",
    "name": "myOceanController", 
    "region": "us-west-2", 
    "autoScaler": {
      "isEnabled": true,
      "cooldown": 180,
      "down": {
        "evaluationPeriods": 3,
        "maxScaleDownPercentage": 60
      },
      "headroom": {
        "cpuPerUnit": 2000,
        "memoryPerUnit": 0,
        "numOfUnits": 4
      },
      "resourceLimits": {
         "maxVCpu": 2,
         "maxMemoryGib": 1
       },
      "isAutoConfig": false
    },
    "capacity": {
      "minimum": 0,
      "maximum": 0,
      "target": 0
    },
    "strategy": {
      "fallbackToOd": true,
      "utilizeReservedInstances": true,
      "drainingTimeout": 60
    },
    "compute": {
      "subnetIds": [
        "subnet-79da021e"
      ],
     "instanceTypes": {
      "whitelist": [
        "c4.2xlarge",
        "c4.xlarge",
        "c4.4xlarge",
        "c4.8xlarge"
       ]
     },
    "launchSpecification": {
      "securityGroupIds": [
        "sg-c3d914b0"
      ],
      "iamInstanceProfile": {
        "arn": "orfrom"
      },
      "keyPair": "spotinst-labs-oregon",
      "tags": [
        {
          "tagKey": "creator",
          "tagValue": "orfrom"
        },
        {
          "tagKey": "k8s.io/role/node",
          "tagValue": "1"
        }
      ],
      "associatePublicIpAddress" : true,
      "monitoring": false,
      "ebsOptimized": false,
      "userData": "ZW5jb2RlbWVwbGVhc2U="
      }
    }
  }
}

Body Attributes


  • cluster Object
    The Ocean cluster object
  • cluster.clusterName * String
    ECS cluster name
  • cluster.name * String
    Add a name for the Ocean cluster.
  • cluster.region * String
    Select the region for the Ocean cluster to run in.
    Example: us-east-1
  • cluster.autoScaler Object
    The Ocean Kubernetes Autoscaler.
  • cluster.autoScaler.isEnabled Boolean
    Enable the Ocean Kubernetes Autoscaler.
    Default: true
  • cluster.autoScaler.cooldown Integer
    Cooldown period between scaling actions. Value should be cooldown period in seconds, greater than 180
    Default: null
  • cluster.autoScaler.resourceLimits Object
    Optionally set upper and lower bounds on the resource usage of the cluster.
  • cluster.autoScaler.resourceLimits.maxMemoryGib Integer
    The maximum memory in GiB units that can be allocated to the cluster. minimum value: 1.
  • cluster.autoScaler.resourceLimits.maxVCpu Integer
    The maximum cpu in vCpu units that can be allocated to the cluster. minimum value: 1.
  • cluster.autoScaler.down Object
    Auto Scaling scale down operations.
  • cluster.autoScaler.down.evaluationPeriods Integer
    The number of evaluation periods that should accumulate before a scale down action takes place. Value should be >= 3
    Default: null
  • cluster.autoScaler.down.maxScaleDownPercentage Integer
    Would represent the maximum % to scale-down. Number between 1-100
  • cluster.autoScaler.headroom Object
    Spare resource capacity management enabling fast assignment of Pods without waiting for new resources to launch.
  • cluster.autoScaler.headroom.cpuPerUnit Integer
    Optionally configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU.
    Example: 2000
  • cluster.autoScaler.headroom.memoryPerUnit Integer
    Optionally configure the amount of memory (MB) to allocate the headroom.
  • cluster.autoScaler.headroom.numOfUnits Integer
    The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.
  • cluster.autoScaler.isAutoConfig Boolean
    Automatically configure and optimize headroom resources.
    Default: true
  • cluster.capacity Object
    Capacity specifications for the Ocean cluster.
  • cluster.capacity.target Integer
    Number of instances to launch and maintain in cluster.
  • cluster.capacity.minimum Integer
    The bottom limit of instances that the cluster can scale down to.
  • cluster.capacity.maximum Integer
    The upper limit of instances that the cluster can scale up to.
    Default: 1000
  • cluster.strategy Object
  • cluster.strategy.fallbackToOd Boolean
    If no Spot instance markets are available, enable Ocean to launch On-Demand instances instead.
    Default: true
  • cluster.strategy.utilizeReservedInstances Boolean
    If Reserved Instances exist, Ocean will utilize them before launching Spot instances.
    Default: false
  • cluster.strategy.drainingTimeout Integer
    The draining timeout (in seconds) before terminating the instance. If no draining timeout is defined, the default draining timeout will be used.
    Example: 60
  • cluster.compute * Object
  • cluster.compute * Object
  • cluster.compute.subnetIds * Array<String>
    A comma-separated list of subnet identifiers for the Ocean cluster. Subnet IDs should be configured with auto assign public IP.
  • cluster.compute.instanceTypes Object
    The type of instances that may or may not be a part of the Ocean cluster.
  • cluster.compute.instanceTypes.whitelist Array<String>
    Instance types allowed in the Ocean cluster.
    Cannot be configured if blacklist is configured.
  • cluster.compute.instanceTypes.blacklist Array<String>
    Instance types to avoid launching in the Ocean cluster. Cannot be configured if whitelist is configured.
  • cluster.compute.launchSpecification * Object
  • cluster.compute.launchSpecification.userData Base64
    The Base64-encoded MIME user data to make available to the instances.
  • cluster.compute.launchSpecification.securityGroupIds * Array<String>
    One or more Security Group IDs.
  • cluster.compute.launchSpecification.iamInstanceProfile * Object
    The instance profile iamRole.
  • cluster.compute.launchSpecification.iamInstanceProfile.arn String
    The iamRole arn.
  • cluster.compute.launchSpecification.keyPair String
    The key pair to attach the instances.
  • cluster.compute.launchSpecification.tags Array
    Optionally add tags to instances launched in Ocean cluster.
  • cluster.compute.launchSpecification.tags.tagKey String
    The tag key.
  • cluster.compute.launchSpecification.tags.tagValue String
    The tag value.
  • cluster.compute.launchSpecification.associatePublicIpAddress Boolean
    Configure public IP address allocation
    Default: False
  • cluster.compute.launchSpecification.monitoring Boolean
    Enable detailed monitoring for cluster. Flag will enable Cloud Watch detailed detailed monitoring (one minute increments). Note: there are additional hourly costs for this service based on the region used
  • cluster.compute.launchSpecification.ebsOptimized Boolean
    Enable EBS optimized for cluster. Flag will enable optimized capacity for high bandwidth connectivity to the EB service for non EBS optimized instance types. For instances that are EBS optimized this flag will be ignored
Response - 200

Body
Copied!
Downloaded!
{
    "request": {
        "id": "6b9f7c91-140e-4c8b-9b40-edde4fac243f",
        "url": "/ocean/aws/ecs/cluster?accountId=act-7461862f",
        "method": "POST",
        "timestamp": "2019-06-18T06:28:08.637Z"
    },
    "response": {
        "status": {
            "code": 200,
            "message": "OK"
        },
        "kind": "spotinst:ocean:aws:ecs",
        "items": [
            {
                "id": "o-bd3ed435",
                "name": "myOceanController",
                "clusterName": "oceanEcs-FirstOfHisName",
                "autoScaler": {
                    "isEnabled": true,
                    "cooldown": 180,
                    "down": {
                        "evaluationPeriods": 3,
                        "maxScaleDownPercentage": 60
                     },
                     "headroom": {
                         "cpuPerUnit": 2000,
                         "memoryPerUnit": 0,
                         "numOfUnits": 4
                     },
                     "resourceLimits": {
                     "maxVCpu": 2,
                     "maxMemoryGib": 1
                      },
                     "isAutoConfig": false
                 },
                "region": "us-west-2",
                "capacity": {
                    "minimum": 0,
                    "maximum": 0,
                    "target": 0
                },
                "strategy": {
                    "utilizeReservedInstances": true,
                    "fallbackToOd": true,
                    "drainingTimeout": 60
                },
                "compute": {
                    "subnetIds": [
                        "subnet-79da021e"
                    ],
                    "instanceTypes": {
                        "whitelist": [
                            "c4.2xlarge",
                            "c4.xlarge",
                            "c4.4xlarge",
                            "c4.8xlarge"
                        ]
                    },
                    "launchSpecification": {
                        "securityGroupIds": [
                            "sg-c3d914b0"
                        ],
                        "iamInstanceProfile": {
                            "arn": "orfrom"
                        },
                        "keyPair": "spotinst-labs-oregon",
                        "tags": [
                            {
                                "tagKey": "creator",
                                "tagValue": "orfrom"
                            },
                            {
                                "tagKey": "k8s.io/role/node",
                                "tagValue": "1"
                            }
                        ],
                        "loadBalancers": [
                            {
                                "arn": "arn:aws:elasticloadbalancing:us-west-2:922761411234:targetgroup",
                                "type": "TARGET_GROUP"
                            },
                            {
                                "name": "MyClassicLB",
                                "type": "CLASSIC"
                            }
                        ],
                        "associatePublicIpAddress": true,
                        "monitoring": false,
                        "ebsOptimized": false,
                        "userData": ""
                    }
                },
                "createdAt": "2019-06-18T06:28:08.488Z",
                "updatedAt": "2019-06-18T06:28:08.488Z"
            }
        ],
        "count": 1
    }
}