fbpx
GEThttps://api.spotinst.io/ocean/onPrem/k8s/cluster?accountId={ACCOUNT_ID}

Create a new Ocean On-Prem entity.

Prerequisites

The Spotinst Controller is used to monitor the cluster resources and report back to Ocean and is required for Ocean On-Prem. To install the Spotinst Controller, complete and run the following script on a machine with kubectl command line tool installed and configured:

#!/usr/bin/env bash
curl -fsSL http://spotinst-public.s3.amazonaws.com/integrations/kubernetes/cluster-controller/scripts/init.sh | \
SPOTINST_TOKEN=<ENTER YOUR TOKEN HERE> \
SPOTINST_ACCOUNT=<ENTER YOUR SPOTINST ACCOUNT ID HERE> \
SPOTINST_CLUSTER_IDENTIFIER=<ENTER YOUR CLUSTER IDENTIFIER HERE> \
bash

For more on the Spotinst controller and Ocean’s anatomy see the documentation here.

 

URL Parameters

Parameter Type Description
ACCOUNT_ID String

The Spotinst accountId associated with your token.

Request

Headers
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{ 
	"cluster":
    { 
		"name":"ocean",
		"description":"Development",
		"controllerClusterIdentifier":"k8sCluster",
		"pricePerUnit":
          {
            "cpuHour":0.015,
            "memoryHour":0.002
          }
	}
}

Body Attributes


Attribute Type Description
cluster * Object

name * String

The name of the cluster.

description String

Optionally provide a description.

Example: development
controllerClusterIdentifier * String

The cluster Id where the Ocean controller is installed.

pricePerUnit * Object

Ocean will monitor the costs of each resource unit.

cpuHour * Float

The cost per cpu unit (core) hour for the cluster.

memoryHour * Float

The cost per memory unit (GiB) hour for the cluster.

Response - 200

Body
Copied!
Downloaded!
{
  	"response": {
	"status": { "code": 200, "message": "OK" },
	"kind": "spotinst:ocean:onprem:k8s",
	"items": [
	  	{
		"id": "o-18887922",
		"name": "ocean",
		"description": "Development",
		"controllerClusterIdentifier": "k8sCluster",
		"pricePerUnit":
      	{
        	"cpuHour": 0.015,
        	"memoryHour": 0.002
      	},
		"createdAt": "2018-11-26T09:39:52.933Z",
		"updatedAt": "2018-11-26T09:39:52.933Z"
	  	}
	  ],
	"count": 1
	}
}