Cloud Providers /
Create cluster
Required permission
Account > Cloud > Clusters > Create
Request body
- {object}
name
string requiredThe name of the cluster.
min length3max length20pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$description
stringThe description of the cluster.
max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$provider
string requiredCloud provider to be used for the selected resource
one ofaws, azure, civo, gcp, byokregion
string requiredRegion of the cluster.
kubernetesVersion
string requiredKubernetes version of the cluster.
integrationId
stringExisting integration to use for this cluster.
min length3max length20pattern^[a-z]-?[a-z0-9]+(-[a-z0-9]+)*$integration
{object}Cloud provider credential input, required fields dependent on which provider is chosen.
keyfileJson
stringContents of a GCP key file.
accessKey
stringAWS access key.
secretKey
stringAWS secret key.
apiKey
stringDO API key.
nodePools
[array] requiredAn array of node pools.
- {object}
nodeType
string requiredMachine type to be used by the node pool.
nodeCount
integer requiredNumber of nodes to the node pool should be provisioned with.
min0max250autoscaling
{object}Auto scaling settings to use for the node pool. Requires that the cloud provider supports this feature.
enabled
booleanmin
integermin0max249max
integermin1max250computeResources
{object}gpu
{object}mig
{object}enabled
booleanpartitions
[array]- string
timeslicing
{object}enabled
booleannumSlices
numbermin1preemptible
booleanConfigures node pool with preemptible / spot instances if enabled.
diskType
stringThe disk type to use.
diskSize
integer requiredDisk size in GB
min1systemPool
booleanWhen 'provider' is 'azure', at least one system node pool is required per cluster.
availabilityZones
[array] requiredZones in which the node pool should be provisioned.
- string
labels
{object}Set of label keys and values that can be used to determine scheduling via resource tags.
settings
{object}builds
{object}mode
stringone ofpaas, internal, build-clusterplan
stringPlan to use for builds if they are run on the cluster
min length3max length39pattern^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$clusterId
stringCluster to use for scheduling builds
min length3max length39pattern^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$registry
{object}mode
stringone ofpaas, self-hostedregistryId
stringCredentials to use for storing of images.
min length3max length39pattern^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$logging
{object}mode
stringone ofpaas, lokiloki
{object}Required data for loki setting.
s3BucketName
string requireds3AccessKey
string requireds3SecretKey
string requireds3Region
string requiredgcp
{object}GCP specific data. Required when
provider
isgcp
.projectId
string requiredID of the GCP project the cluster will be provisioned in.
aws
{object}AWS specific data. Required when
provider
isaws
.subnets
string requiredList of subnets the cluster should be created for. At least 2 must be specified.
min length2
Response body
- {object}
Response object.
data
{object} requiredResult data.
id
string requiredIdentifier for the cluster.
name
string requiredThe name of the cluster.
description
stringA short description of the cluster.
provider
stringThe cloud provider to which this cluster belongs to.
integrationId
string requiredID of the provider integration used by this cluster.
min length3max length39pattern^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$nodePools
[array] required- {object}
nodeType
string requiredMachine type to be used by the node pool.
nodeCount
integer requiredNumber of nodes to the node pool should be provisioned with.
min0max250autoscaling
{object}Auto scaling settings to use for the node pool. Requires that the cloud provider supports this feature.
enabled
booleanmin
integermin0max249max
integermin1max250computeResources
{object}gpu
{object}mig
{object}enabled
booleanpartitions
[array]- string
timeslicing
{object}enabled
booleannumSlices
numbermin1preemptible
booleanConfigures node pool with preemptible / spot instances if enabled.
diskType
stringThe disk type to use.
diskSize
integer requiredDisk size in GB
min1systemPool
booleanWhen 'provider' is 'azure', at least one system node pool is required per cluster.
availabilityZones
[array] requiredZones in which the node pool should be provisioned.
- string
labels
{object}Set of label keys and values that can be used to determine scheduling via resource tags.
id
stringID of existing node pool. Must be passed when modifying existing node pools. Not relevant for new node pools
status
{object}state
{object}state
stringtransitionTime
stringnextUpdateAfter
stringcreatedAt
string requiredThe time the cluster was created.
deletionRequested
boolean requiredIndicates if provider resource deletion has been requested by the user.
POST /v1/cloud-providers/clusters
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"name":"GCP Cluster 1","description":"This is a new cluster.","provider":"gcp","region":"europe-west2","kubernetesVersion":"1.23.8","integrationId":"gcp-integration","nodePools":[{"nodeType":"n2-standard-8","nodeCount":3,"autoscaling":{"enabled":true,"min":0,"max":10},"computeResources":{"gpu":{"mig":{"partitions":[null]}}},"preemptible":false,"diskSize":100,"availabilityZones":[null]}],"settings":{"builds":{"plan":"nf-compute-200"},"registry":{"registryId":"my-registry-credentials"}},"gcp":{"projectId":"example-project-id"}}' \
https://api.northflank.com/v1/cloud-providers/clusters
Example response
200 OK
JSON
{
"data": {
"id": "gcp-cluster-1",
"name": "GCP Cluster 1",
"description": "The cluster description",
"provider": "gcp",
"integrationId": "gcp-integration",
"nodePools": [
{
"nodeType": "n2-standard-8",
"nodeCount": 3,
"autoscaling": {
"enabled": true,
"min": 0,
"max": 10
},
"computeResources": {
"gpu": {
"mig": {
"partitions": [
null
]
}
}
},
"preemptible": false,
"diskSize": 100,
"availabilityZones": [
null
],
"id": "6aa96121-0345-43ad-bade-af36d540c222"
}
],
"createdAt": "2021-01-20T11:19:53.175Z",
"deletionRequested": false
}
}