Go (SDK)
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Lks.CreateLksNodePool(ctx, "<id>", components.CreateLksNodePool{
Data: components.CreateLksNodePoolData{
Type: components.CreateLksNodePoolTypeLksNodePools,
Attributes: components.CreateLksNodePoolAttributes{
Plan: "c2-small-x86",
Count: 2,
Name: latitudeshgosdk.Pointer("pool-a"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksNodePool != nil {
// handle response
}
}curl --request POST \
--url https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"plan": "c2-small-x86",
"count": 2
}
}
}
'import requests
url = "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools"
payload = { "data": {
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"plan": "c2-small-x86",
"count": 2
}
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'lks_node_pools',
attributes: {name: 'pool-a', plan: 'c2-small-x86', count: 2}
}
})
};
fetch('https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'lks_node_pools',
'attributes' => [
'name' => 'pool-a',
'plan' => 'c2-small-x86',
'count' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"name\": \"pool-a\",\n \"plan\": \"c2-small-x86\",\n \"count\": 2\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"name\": \"pool-a\",\n \"plan\": \"c2-small-x86\",\n \"count\": 2\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "lksnp_9dQKr1pRMLyd",
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"type": "bare_metal",
"mode": "on_demand",
"plan": "c2-small-x86",
"description": "",
"count": 2,
"max_pods_per_node": null,
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"status": "provisioning",
"message": "",
"reason": "WaitingForNodes",
"ready_nodes": null,
"labels": {},
"taints": [],
"created_at": "2026-09-01T12:05:00Z",
"updated_at": "2026-09-01T12:05:00Z"
}
}
}LKS
Create a node pool
Adds a node pool to an LKS cluster. The platform provisions count servers of plan from stock, so both fields are required.
kubernetes_version defaults to the control-plane patch and may never be newer than it. max_pods_per_node is set once, here — it cannot be changed later.
POST
/
lks
/
clusters
/
{cluster_id}
/
nodepools
Go (SDK)
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Lks.CreateLksNodePool(ctx, "<id>", components.CreateLksNodePool{
Data: components.CreateLksNodePoolData{
Type: components.CreateLksNodePoolTypeLksNodePools,
Attributes: components.CreateLksNodePoolAttributes{
Plan: "c2-small-x86",
Count: 2,
Name: latitudeshgosdk.Pointer("pool-a"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksNodePool != nil {
// handle response
}
}curl --request POST \
--url https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"plan": "c2-small-x86",
"count": 2
}
}
}
'import requests
url = "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools"
payload = { "data": {
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"plan": "c2-small-x86",
"count": 2
}
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'lks_node_pools',
attributes: {name: 'pool-a', plan: 'c2-small-x86', count: 2}
}
})
};
fetch('https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'lks_node_pools',
'attributes' => [
'name' => 'pool-a',
'plan' => 'c2-small-x86',
'count' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"name\": \"pool-a\",\n \"plan\": \"c2-small-x86\",\n \"count\": 2\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"name\": \"pool-a\",\n \"plan\": \"c2-small-x86\",\n \"count\": 2\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "lksnp_9dQKr1pRMLyd",
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"type": "bare_metal",
"mode": "on_demand",
"plan": "c2-small-x86",
"description": "",
"count": 2,
"max_pods_per_node": null,
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"status": "provisioning",
"message": "",
"reason": "WaitingForNodes",
"ready_nodes": null,
"labels": {},
"taints": [],
"created_at": "2026-09-01T12:05:00Z",
"updated_at": "2026-09-01T12:05:00Z"
}
}
}Was this page helpful?