POSThttps://api.spotinst.io/ocean/aws/k8s/launchSpec?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!
{
  "launchSpec": {
    "oceanId": "o-123",
    "name": "specialty.nodes.spotk8s.com",
    "imageId": "ami-ID",
    "userData": "dsa89d7uosduxq98sau9s8aux9s8aux09q0qu09axsuix0s9qas09xz",
    "iamInstanceProfile": {
      "arn": "arn:aws:iam::123456781234:instance-profile/EKS-nodes-test-NodeInstanceProfile-ABCDEFGH123",
      "name": "EKS-nodes-test"
    },
    "securityGroupIds": [
      "sg-0ded3a2980208c30c",
      "sg-0ded3a2980208c30d"
    ],
    "rootVolumeSize": 8,
    "labels": [
      {
        "key": "env",
        "value": "test"
      },
      {
        "key": "creator",
        "value": "test"
      }
    ],
    "taints": [
      {
        "key": "taintKey",
        "value": "taintValue",
        "effect": "NoSchedule"
      }
    ],
    "subnetIds": [
      "subnet-123",
      "subnet-456"
    ],
    "autoScale": {
      "headrooms": [
        {
          "cpuPerUnit": 1000,
          "memoryPerUnit": 2048,
          "gpuPerUnit": 0,
          "numOfUnits": 3
        }
      ]
    },
    "tags": [
      {
        "tagKey": "Creator",
        "tagValue": "John Doe"
      },
      {
        "tagKey": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup",
        "tagValue": "nodes"
      },
      {
        "tagKey": "k8s.io/role/node",
        "tagValue": "1"
      },
      {
        "tagKey": "KubernetesCluster",
        "tagValue": "from2.ek8s.com"
      },
      {
        "tagKey": "kops.k8s.io/instancegroup",
        "tagValue": "nodes"
      }
    ]
  }
}

Body Attributes


Attribute Type Description
launchSpec.oceanId * String

The Ocean cluster ID. required for launchSpec create.

launchSpec.name String

Set Launch Specification name

launchSpec.imageId String

Set image ID. Can be null

launchSpec.userData String

Set user data script in Base64-encoded MIME

launchSpec.iamInstanceProfile Object

The instance profile iamRole object

launchSpec.iamInstanceProfile.arn String

The iamRole arn. If set - do not set launchSpec.iamInstanceProfile.name

launchSpec.iamInstanceProfile.name String

The iamRole name. If set - do not set launchSpec.iamInstanceProfile.arn

launchSpec.securityGroupIds Array<String>

Set security groups. Each element in array should be security group ID

launchSpec.rootVolumeSize Integer

Set root volume size (in GB)

launchSpec.labels Array<Object>

Add labels to cluster

launchSpec.labels.key String

Set label key

launchSpec.labels.value String

Set label value

launchSpec.taints Array<Object>

Add taints to cluster

launchSpec.taints.key String

Set taints key

launchSpec.taints.value String

Set taints value

launchSpec.taints.effect String

Set taints effect

Example: NoSchedule
launchSpec.subnetIds Array<String>

Set subnets in launchSpec. Each element in array should be subnet ID

launchSpec.autoScale Object

launchSpec.autoScale.headrooms Array<Object>

Set custom headroom per launch spec. provide list of launchSpec.autoscale.headrooms object

launchSpec.autoScale.headrooms.cpuPerUnit Integer

configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU

Example: 2000
launchSpec.autoScale.headrooms.memoryPerUnit Integer

Configure the amount of memory (MiB) to allocate the headroom.

Example: 2048
launchSpec.autoScale.headrooms.gpuPerUnit Integer

How much GPU allocate for headroom unit

Example: 1
launchSpec.autoScale.headrooms.numOfUnits Integer

The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.

Example: 3
launchSpec.tags Array<Object>

List of kay-value pairs of tags

launchSpec.tags.tagKey String

Set the tag key

launchSpec.tags.tagValue String

Set the tag value

Response - 200

Body
Copied!
Downloaded!
{
  "request": {
    "id": "XXXXXXX-abce-XXXX-XXXX-XXX11111XXXX",
    "url": "/ocean/aws/k8s/launchSpec/ols-123?accountId=XXXXXXXX",
    "method": "post",
    "timestamp": "2019-02-19T18:25:51.767Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:ocean:aws:k8s",
    "items": [
      {
        "oceanId": "o-123",
        "imageId": "ami-ID",
        "userData": "dsa89d7uosduxq98sau9s8aux9s8aux09q0qu09axsuix0s9qas09xz",
        "iamInstanceProfile": {
          "arn": "arn:aws:iam::123456781234:instance-profile/EKS-nodes-test-NodeInstanceProfile-ABCDEFGH123",
          "name": "EKS-nodes-test"
        },
        "securityGroupIds": [
          "sg-0ded3a2980208c30c",
          "sg-0ded3a2980208c30d"
        ],
        "rootVolumeSize": 8,
        "labels": [
          {
            "key": "env",
            "value": "test"
          },
          {
            "key": "creator",
            "value": "test"
          }
        ],
        "taints": [
          {
            "key": "taintKey",
            "value": "taintValue",
            "effect": "NoSchedule"
          }
        ],
        "subnetIds": [
          "subnet-123",
          "subnet-456"
        ],
        "autoscale": {
          "headrooms": [
            {
              "cpuPerUnit": 1000,
              "memoryPerUnit": 2048,
              "gpuPerUnit": 0,
              "numOfUnits": 3
            }
          ]
        },
        "tags": [
          {
            "tagKey": "Creator",
            "tagValue": "John Doe"
          },
          {
            "tagKey": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup",
            "tagValue": "nodes"
          },
          {
            "tagKey": "k8s.io/role/node",
            "tagValue": "1"
          },
          {
            "tagKey": "KubernetesCluster",
            "tagValue": "from2.ek8s.com"
          },
          {
            "tagKey": "kops.k8s.io/instancegroup",
            "tagValue": "nodes"
          }
        ],
        "createdAt": "2019-02-19T18:25:51.752Z",
        "updatedAt": "2019-02-19T18:25:51.752Z"
      }
    ],
    "count": 1
  }
}