fbpx
POSThttps://api.spotinst.io/gcp/gce/group/gke/import?location={CLUSTER_LOCATION}&accountId={ACCOUNT_ID}&clusterId={CLUSTER_ID}

Import existing GKE cluster to Elastigroup.

URL Parameters

ParameterTypeDescription
ACCOUNT_ID * String

Your Spotinst accountId associated with your token

Example: act-123abc
CLUSTER_LOCATION * String

The location of the cluster. Enter the Zone for zonal GKE clusters or the region for regional GKE clusters.

Example: us-central1-a
CLUSTER_ID * String

The GKE Cluster identifier

Example: myGKECluster
NODE_POOL_NAME String

Set node pool to import

Request

Headers
{
	"Content-Type": "application/json",
	"Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "group": { 
    "name": "myGKE", 
    "preemptiblePercentage": 70, 
    "capacity": { 
      "minimum": 0, 
      "maximum": 0, 
      "target": 0 
    }, 
     "instanceTypes":{ 
     "ondemand": "n1-highcpu-32", 
     "preemptible": [ 
          "n1-standard-1"] 
    }, 
 	"availabilityZones": ["us-central1-a"]
  }
} 

Body Attributes


  • name String
    The Name of the Elastigroup
    Example: GKEgroup01
  • preemptiblePercentage Integer
    Preemptive vms ratio in the Elastigroup
    Example: 70
    Default: 100
  • capacity Object
    minimum, maximum and target number of vms in the Elastigroup
  • capacity.minimum * Integer
    The minimal amount of vms in the group
    Example: 1
    Default: 1
  • capacity.maximum * Integer
    The maximal amount of vms in the group
    Example: 5
    Default: 5
  • capacity.target * Integer
    Target number of VMs for Elastigroup to maintain
    Example: 3
    Default: 3
  • instanceTypes Object
    Types and locations of vms to be used
  • instanceTypes.ondemand String
    On-demand vm type to be used in case an on demand vm is launched
    Example: n1-standard-1
  • instanceTypes.preemptible Array<String>
    Preemptive vm types to be used in case a preemptive vm is launched
    Example: n1-standard-1,n1-standard-2
  • availabilityZones Array<String>
    Zones pool to be used in the group
    Example: us-central1-a,us-central1-b
Response - 200

Headers
{
	"Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "request": {
        "id": "0c536755-b44f-4f19-96a7-9487fc645f0c",
        "url": "/gcp/gce/group/gke/import?location=us-central1-a&clusterId=myGKE",
        "method": "POST",
        "timestamp": "2018-06-14T08:34:56.644Z"
    },
    "response": {
        "status": {
            "code": 200,
            "message": "OK"
        },
        "kind": "spotinst:gcp:gce:importGke",
        "items": [
         {
            "id": "sig-642b8368",
            "name": "Spotinst GCP Group",
            "description": "Spotinst GCP Group",
            "capacity": {
              "minimum": 0,
              "maximum": 0,
              "target": 0
            },
            "scheduling": {
              "tasks": [
                {
                  "isEnabled": true,
                  "taskType": "setCapacity",
                  "cronExpression": "1 10 * * *",
                  "targetCapacity": 2,
                  "minCapacity": 1,
                  "maxCapacity": 3
                }
              ]
            },
            "strategy": {
              "preemptiblePercentage": 50,
              "fallbackToOd": true
            },
            "compute": {
              "launchSpecification": {
                "serviceAccount": "example@myProject.iam.gserviceaccount.com",
                "tags": [
                  "http",
                  "https"
                ],
                "backendServices": [
                  "spotinst-elb-backend-service"
                ],
                "backendServiceConfig": {
                  "backendServices": [
                    {
                      "backendServiceName": "bs-2",
                      "locationType": "global",
                      "scheme": null,
                      "namedPorts": {
                        "name": "https",
                        "ports": [
                          443,
                          8443
                        ]
                      }
                    }
                  ]
                },
                "disks": [
                  {
                    "deviceName": "device",
                    "initializeParams": {
                      "diskSizeGb": 10,
                      "diskType": "pd-standard",
                      "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20151104"
                    },
                    "mode": "READ_WRITE",
                    "type": "PERSISTENT",
                    "autoDelete": true,
                    "boot": true,
                    "interface": "SCSI"
                  }
                ],
                "networkInterfaces": [
                  {
                    "network": "spot-network"
                  }
                ]
              },
              "instanceTypes": {
                "ondemand": "n1-standard-1",
                "preemptible": [
                  "n1-standard-1",
                  "n1-standard-2",
                  "n1-standard-4"
                ]
              },
              "availabilityZones": [
                "asia-east1-c",
                "europe-west1-c",
                "us-central1-a"
              ]
            },
            "scaling": {
              "up": [
                {
                  "policyName": "scale_up_1",
                  "source": "stackdriver",
                  "metricName": "instance/disk/read_ops_count",
                  "statistic": "average",
                  "unit": "percent",
                  "threshold": 10000,
                  "namespace": "compute",
                  "period": 300,
                  "evaluationPeriods": 1,
                  "cooldown": 300,
                  "operator": "gte",
                  "dimensions": [
                    {
                      "name": "storage_type",
                      "value": "pd-standard"
                    }
                  ],
                  "action": {
                    "type": "adjustment",
                    "adjustment": 1
                  }
                },
               "down": [
                {
                    "policyName": "scale_down_1",
                    "source": "stackdriver",
                    "metricName": "instance/disk/read_ops_count",
                    "statistic": "average",
                    "unit": "percent",
                    "threshold": 1000,
                    "namespace": "compute",
                    "period": 300,
                    "evaluationPeriods": 1,
                    "cooldown": 300,
                    "operator": "lte",
                    "dimensions": [
                        {
                            "name": "storage_type",
                            "value": "pd-standard"
                        }],
                    "action": {
                        "type": "adjustment",
                        "adjustment": 1
                    }
                }]
              ]
            },
            "thirdPartiesIntegration": {
                "dockerSwarm": {
                    "masterHost": "swarm1.swarm.com",
                    "masterPort": 1234
                },
                "gke": {
                    "autoUpdate": true,
                    "autoScale": {
                        "isEnabled": true,
                        "isAutoConfig": false,
                        "cooldown": 300,
                        "headroom": {
                            "cpuPerUnit": 1,
                            "memoryPerUnit": 0,
                            "numOfUnits": 1
                        },
                        "down": {
                            "evaluationPeriods": 5 
                        }
                    },
                    "clusterIdentifier": "gke-clust-1",
                    "location": "us-west1"
                }
            },
            "createdAt": "2016-02-14T09:15:09.000+0000",
            "updatedAt": "2016-02-14T09:15:09.000+0000"
          }
        ],
        "count": 1
    }
}