POSThttps://api.spotinst.io/ocean/gcp/k8s/launchSpec?accountId={ACCOUNT_ID}

URL Parameters

Parameter Type Description
ACCOUNT_ID * String

The Spot accountId associated with your token.

Example: act-123abc
Request

Headers
Copied!
Downloaded!
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "launchSpec": {
    "oceanId": "o-1fff54ed",
    "name": "lp_name",
    "sourceImage": "https://www.googleapis.com/compute/v1/projects/gke-node-images/global/images/container-v1-3-v20160517",
    "rootVolumeSize": 8,
    "metadata": [
      {
        "key": "key1",
        "value": "value1"
      },
      {
        "key": "value1",
        "value": "value2"
      }
    ],
    "taints": [
      {
        "key": "test",
        "value": "test",
        "effect": "NoExecute"
      }
    ],
    "labels": [
      {
        "key": "test",
        "value": "test"
      }
    ],
    "autoScale": {
      "headrooms": [
        {
          "cpuPerUnit": 1000,
          "memoryPerUnit": 2048,
          "gpuPerUnit": 0,
          "numOfUnits": 3
        }
      ]
    },
    "resourceLimits": {
      "maxInstanceCount": 5
    }
  }
}

Body Attributes


Attribute Type Description
launchSpec * Object

launchSpec.oceanId * String

The Ocean cluster ID. required for launchSpec create.

launchSpec.name String

Set name for . the launch spec

launchSpec.sourceImage * String

Set image URL. Can be null

launchSpec.rootVolumeSize Integer

Set root volume size (in GB)

launchSpec.metadata Array<Object>

Add metadata to cluster

launchSpec.metadata.key * String

Set metadata's key. Required on launchSpec.metadata

launchSpec.metadata.value * String

Set metadata's name. Required on launchSpec.metadata

launchSpec.taints Array<Object>

Add taints to cluster

launchSpec.taints.key String

taint's key

launchSpec.taints.value String

taint's value

launchSpec.taints.effect String

taint's effect

Example: NoExecute
launchSpec.labels Array<Object>

Add labels on cluster

launchSpec.labels.key String

Set label key

launchSpec.labels.value String

Set label value

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.resourceLimits Object

launchSpec.resourceLimits.maxInstanceCount Integer

Option to set a maximum number of instances per launch specification. Can be null. If set, value must be greater than or equal to 0.

Example: 5
Response - 200

Body
Copied!
Downloaded!
{
    "request": {
        "id": "c77fd005-04b3-4e8b-93a9-bb48e9cf44b9",
        "url": "/ocean/gcp/k8s/launchSpec?spotinstAccountId=act-7461862f",
        "method": "POST",
        "timestamp": "2019-06-15T10:48:38.242Z"
    },
    "response": {
        "status": {
            "code": 200,
            "message": "OK"
        },
        "kind": "spotinst:ocean:gcp:k8s",
        "items": [
			{
		        "oceanId" : "o-1fff54ed",
                "name": "lp_name",
		        "sourceImage":"https://www.googleapis.com/compute/v1/projects/gke-node-images/global/images/container-v1-3-v20160517",
		        "rootVolumeSize": 8,
                "metadata": [
		                        {
		                            "key": "key1",
		                            "value": "value1"
		                        },
		                        {
		                            "key": "value1",
		                            "value": "value2"
		                        }
		                    ],
		        "taints": [
		            {
		                "key":"test",
		                "value":"test",
		                "effect":"NoExecute"
		            }
		            ],
		        "labels":[
		            {
		                "key":"test",
		                "value":"test"
		            }
				],
				"autoScale": {
		        	"headrooms": [
	    		    {
    	    		  "cpuPerUnit": 1000,
	        		  "memoryPerUnit": 2048,
			          "gpuPerUnit": 0,
    			      "numOfUnits": 3
        			}]
		      	},
                "createdAt": "2019-06-15T10:48:38.065Z",
                "updatedAt": "2019-06-15T10:48:38.065Z"
            }
        ],
        "count": 1
    }
}