fbpx
PUThttps://api.spotinst.io/ocean/gcp/k8s/cluster/{OCEAN_CLUSTER_ID}?accountId={ACCOUNT_ID}

URL Parameters

Parameter Type Description
OCEAN_CLUSTER_ID * String

The Ocean cluster to update.

ACCOUNT_ID * String

The Spotinst accountId associated with your token.

Example: act-123abc

All Ocean parameters are updatable, excluding the Name and controllerClusterId.

This API supports partial updates, so specific fields can be updated separately.

Request - Example - Update Group Capacity

Headers
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
   "cluster":{
        "capacity": {
            "minimum": 3,
            "maximum": 50,
            "target": 20
        }
   }
}

Body Attributes


  • cluster Object
    The Ocean cluster.
  • cluster.name * String
    Add a name for the Ocean cluster.
  • cluster.controllerClusterId * String
    Enter the Ocean cluster identifier.
    Example: ocean.k8s
  • cluster.gke Object
    Use existing GKE cluster
  • cluster.gke.clusterName * String
    Required on cluster.gke object.
  • clusterName.gke.masterLocation * String
    Required on cluster.gke object.
  • cluster.autoScaler Object
    The Ocean Kubernetes Autoscaler object
  • cluster.autoScaler.isEnabled Boolean
    Enable the Ocean Kubernetes Autoscaler.
    Default: true
  • cluster.autoScaler.cooldown Integer
    Cooldown period between scaling actions.
    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.
  • cluster.autoScaler. resourceLimits.maxVCpu Integer
    The maximum cpu in vCpu units that can be allocated to the cluster.
  • 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.
    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.gpuPerUnit Integer
    How much GPU allocate for headroom unit
  • 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.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.subnetname * String
    Subnet identifier for the Ocean cluster
  • 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.
  • cluster.compute.launchSpecification * Object
  • cluster.compute.launchSpecification.sourceImage * String
    URL of the image used to launch the instances.
  • cluster.compute.launchSpecification.tags * Array
    Array of tags to instances launched in Ocean cluster.
  • cluster.compute.launchSpecification.metadata * Array<Object>
    Set array of cluster metadata
  • cluster.compute.launchSpecification.metadata.key String
    Key of metadata key-pair
  • cluster.compute.launchSpecification.metadata.value String
    Value of metadata key-pair
  • cluster.compute.launchSpecification.ipForwarding Boolean
  • cluster.compute.launchSpecification.minCpuPlatform String
    Set instance CPU platform
    Example: Intel Sandy Bridge
  • cluster.compute.launchSpecification.serviceAccount * String
  • cluster.compute.launchSpecification.rootVolumeSizeInGb String
    Optionally set root size (GB). Value should be >= 100
  • cluster.compute.launchSpecification.labels Array<Object>
    Set labels on cluster. Can set up to 60 labels
  • cluster.compute.launchSpecification.labels.key String
  • cluster.compute.launchSpecification.labels.value String
  • cluster.compute.networkInterfaces * Object
    Settings for network interfaces
  • cluster.compute.networkInterfaces.network * String
  • cluster.compute.networkInterfaces.projectId String
    Use network resource from different project. set project ID to use it's network resource. This parameter relevant only If the network resource is in different project
  • cluster.compute.networkInterfaces.accessConfigs * Array<Object>
  • cluster.compute.networkInterfaces.accessConfigs.name * String
  • cluster.compute.networkInterfaces.accessConfigs.type * String
    Possible values: ONE_TO_ONE_NAT
  • cluster.compute.networkInterfaces.aliasIpRanges String
  • cluster.compute.networkInterfaces.aliasIpRanges.ipCidrRange * String
    Required on cluster.compute.networkInterfaces.aliasIpRanges object.
  • cluster.compute.networkInterfaces.aliasIpRanges.subnetworkRangeName * String
    Required on cluster.compute.networkInterfaces.aliasIpRanges object.
  • cluster.compute.backendServices Object
    Settings for backend services
  • cluster.compute.backendServices.backendServiceName * String
    Required on cluster.compute.backendServices object.
  • cluster.compute.backendServices.locationType String
  • cluster.compute.backendServices.cluster.compute.backendServices.Scheme String
  • cluster.compute.backendServices.cluster.compute.backendServices.namedPort String
  • cluster.compute.backendServices.cluster.compute.availabilityZones Array
    Array of availability zones for the cluster
Response - 200

Body
Copied!
Downloaded!
{
	"cluster": {
		"autoScaler": {
      		"isEnabled": true,
      		"cooldown": 30,
      		"down": {
        		"evaluationPeriods": 3,
        		"maxScaleDownPercentage": 30
			},
			"headroom": {
				"cpuPerUnit": 0,
				"memoryPerUnit": 0,
				"gpuPerUnit": 0,
				"numOfUnits": 0
			},
      		"resourceLimits": {
				"maxMemoryGib": 1500,
				"maxVCpu": 750
      		},
      		"isAutoConfig": false
		},
		"capacity": {
			"minimum": 0,
			"maximum": 3,
			"target": 3
		},
        "strategy": {
			"drainingTimeout": 60
		},
		"compute": {
                    "networkInterfaces": [
                        {
                            "network": "default",
                            "accessConfigs": [
                                {
                                    "name": "external-nat",
                                    "type": "ONE_TO_ONE_NAT"
                                }
                            ],
                            "aliasIpRanges": [
                                {
                                    "ipCidrRange": "/24",
                                    "subnetworkRangeName": "gke-test-native-vpc-pods-5cb557f7"
                                }
                            ]
                        }
                    ],
					"backendServices":[
        				{
        				"backendServiceName":"test-global-tcp",
        				"locationType":"global"
        				}
					],
                    "subnetName": "default",
                    "instanceTypes": {
                        "whitelist": [
                            "n1-standard-2"
                        ]
                    },
                    "launchSpecification": {
                        "sourceImage": "https://www.googleapis.com/compute/v1/projects/gke-node-images/global/images/gke-1117-gke12-cos-69-10895-138-0-v190225-pre",
                        "metadata": [
						  {
                              "key": "example_key1",
                              "value": "exmample_value1"
                          },
                          {
                              "key": "example_key2",
                              "value": "example_value2"
                          }
                        ],
                        "tags": [
                            "gke-test-native-vpc-5cb557f7-node"
                        ],
                        "ipForwarding": true,
						"minCpuPlatform": "Intel Sandy Bridge",
                        "serviceAccount": "265168459660-compute@developer.gserviceaccount.com",
                        "labels": [
                            {
                                "key": "spotinst-gke-original-node-pool",
                                "value": "test-native-vpc__default-pool"
                            }
                        ],
                        "rootVolumeSizeInGb": 100
                    },
                    "availabilityZones": [
                        "us-central1-a"
                    ]
                }
			}
}