Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.lks.create_lks_node_pool(cluster_id="<id>", data={
"type": latitudesh_python_sdk.CreateLksNodePoolType.LKS_NODE_POOLS,
"attributes": {
"plan": "c2-small-x86",
"count": 2,
"name": "pool-a",
},
})
# Handle response
print(res)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: latitudeshgosdk.Pointer("c2-small-x86"),
Count: latitudeshgosdk.Pointer[int64](2),
Name: latitudeshgosdk.Pointer("pool-a"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksNodePool != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.lks.createLksNodePool({
clusterId: "<id>",
createLksNodePool: {
data: {
type: "lks_node_pools",
attributes: {
plan: "c2-small-x86",
count: 2,
name: "pool-a",
},
},
},
});
console.log(result);
}
run();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
}
}
}
'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",
"server_ids": null,
"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. mode decides where the pool’s nodes come from:
on_demand(default): the platform provisionscountservers ofplanfrom stock, so both fields are required.allocated: the pool is built fromserver_ids, bare metal servers already in the cluster project. Each server is reinstalled with the LKS node image, which erases its disks.planandcountare rejected: the pool uses the plan the servers share, andcountis the number of servers. Each server that fails an eligibility check is reported as its own 422 error, pointing at its index inserver_idsand listing every reason inmeta.reasons.GET /lks/allocatable_serversshows which servers can join. Allocated node pools are available only in on-demand projects: a reserved project is refused with 422RESERVED_PROJECT_NOT_SUPPORTED.
kubernetes_version defaults to the control-plane patch and may never be newer than it. max_pods_per_node and mode are set once, here — they cannot be changed later.
POST
/
lks
/
clusters
/
{cluster_id}
/
nodepools
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.lks.create_lks_node_pool(cluster_id="<id>", data={
"type": latitudesh_python_sdk.CreateLksNodePoolType.LKS_NODE_POOLS,
"attributes": {
"plan": "c2-small-x86",
"count": 2,
"name": "pool-a",
},
})
# Handle response
print(res)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: latitudeshgosdk.Pointer("c2-small-x86"),
Count: latitudeshgosdk.Pointer[int64](2),
Name: latitudeshgosdk.Pointer("pool-a"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksNodePool != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.lks.createLksNodePool({
clusterId: "<id>",
createLksNodePool: {
data: {
type: "lks_node_pools",
attributes: {
plan: "c2-small-x86",
count: 2,
name: "pool-a",
},
},
},
});
console.log(result);
}
run();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
}
}
}
'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",
"server_ids": null,
"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?