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

Import existing GKE cluster to Elastigroup.

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Your Spotinst accountId associated with your token

Example: act-123abc
CLUSTER_ZONE_NAME * String

The Zone in which the cluster masters are running

Example: us-central1-a
CLUSTER_ID * String

The GKE Cluster identifier

Example: myGKECluster
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"], 
    "nodeImage": "UBUNTU" 
  }
} 

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
  • nodeImage String
    The image that will be used for the nodes vms. Possible values: COS, UBUNTU
    Example: UBUNTU
    Default: COS
Response - 200

Headers
{
	"Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "request": {
        "id": "0c536755-b44f-4f19-96a7-9487fc645f0c",
        "url": "/gcp/gce/group/gke/import?zone=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-96a29200",
                "name": "gkeCluster",
                "capacity": {
                    "minimum": 0,
                    "maximum": 0,
                    "target": 0
                },
                "strategy": {
                    "preemptiblePercentage": 70
                },
                "compute": {
                    "launchSpecification": {
                        "metadata": [
                            {
                                "...": "..."
                            }
                        ],
                        "disks": [
                            {
                                "initializeParams": {
                                    "diskSizeGb": 100,
                                    "diskType": "pd-standard",
                                    "sourceImage": "https://www.googleapis.com/compute/v1/projects/ubuntu-os-gke-cloud/global/images/ubuntu-gke-1604-xenial-v20180308"
                                },
                                "mode": "READ_WRITE",
                                "type": "PERSISTENT",
                                "autoDelete": true,
                                "boot": true
                            }
                        ],
                        "networkInterfaces": [
                            {
                                "network": "default",
                                "accessConfigs": [
                                    {
                                        "name": "public ip",
                                        "type": "ONE_TO_ONE_NAT"
                                    }
                                ]
                            }
                        ],
                        "serviceAccount": "308294713526-ea45sdi0juqbtpsarcmflq0en88hmk51@developer.gserviceaccount.com"
                    },
                    "instanceTypes": {
                        "ondemand": "n1-highcpu-32",
                        "preemptible": [
                            "n1-standard-1"
                        ]
                    },
                    "availabilityZones": [
                        "us-central1-a"
                    ]
                },
                "thirdPartiesIntegration": {
                    "gke": {
                        "clusterIdentifier": "cluster",
                        "location": "us-central1-a"
                    }
                },
                "createdAt": "2018-06-14T08:34:56.636+0000",
                "updatedAt": "2018-06-14T08:34:56.636+0000"
            }
        ],
        "count": 1
    }
}