Create a Kubernetes cluster
Create a cluster with its control plane and workers. Leave out node_pools, or send an empty list, to create a cluster without workers.
Bearer $TOKEN
application/json
The ID of the team that owns the cluster. betterstack team list shows it.
The cluster's name, up to 255 characters. Must be unique among the organization's clusters that aren't failed or destroyed.
The Kubernetes version as major and minor number, such as 1.36. List the versions with betterstack kubernetes-version list. Defaults to the newest version.
The IPv4 range for pods. Can't overlap service_cidr, the range we use for the cluster, or a network you attach. Can't be changed later.
The IPv4 range for Kubernetes services. Can't overlap pod_cidr, the range we use for the cluster, or a network you attach. Can't be changed later.
The IP ranges allowed to reach the cluster's Kubernetes API, as 1 to 50 IPv4 or IPv6 CIDRs. Leave it out, or send null, to allow every address.
The IDs of private networks of the cluster's team to attach to the cluster.
The IDs of firewalls to attach to the workers.
The cluster's node pools, up to 10, with up to 100 workers in total. Workers are servers, so server types and server quotas apply to them.
The node pool's name, unique in the cluster. Up to 30 lowercase letters, digits and hyphens, starting and ending with a letter or digit.
The server type of the workers. List the server types with betterstack server-type list.
How many workers the node pool should have, from 0 to 100. A cluster can have 100 workers in total.
The Kubernetes labels of the workers, up to 10 string pairs. Keys and values have up to 63 characters. Accepts any keys.
The Kubernetes taints of the workers, up to 10.
The taint's key, in the form of a Kubernetes label key.
The taint's value, up to 63 characters.
What the taint does to pods that don't tolerate it, as in Kubernetes. Possible values: NoSchedule, PreferNoSchedule, NoExecute.
Your own tags, up to 10 string pairs. The keys kubernetes-cluster, kubernetes-node-pool and kubernetes-service-uid are reserved for Better Stack and can't be set. Accepts any keys.
{
"id": "example",
"name": "Example Kubernetes cluster",
"version": "1.4.2",
"patch_version": "1.4.2",
"available_versions": [
"1.4.2"
],
"status": "provisioning",
"status_message": "example",
"endpoint": {
"hostname": "proxy.example.com",
"port": 6443,
"api_allowed_cidrs": [
"example"
]
},
"pod_cidr": "10.42.0.0/16",
"service_cidr": "10.43.0.0/16",
"nodes_ready": 1,
"nodes_total": 1,
"node_pools": [
{
"id": "example",
"name": "Example",
"server_type": "example",
"node_count": 50,
"labels": {
"example": "value"
},
"taints": [
{
"key": "example",
"value": "example",
"effect": "NoSchedule"
}
],
"status": "active",
"status_message": "example",
"nodes_ready": 1,
"scaling": {
"from": 1,
"to": 1,
"started_at": "2026-07-01T12:00:00.000Z",
"estimated_ready_at": "2026-07-01T12:00:00.000Z"
},
"nodes": [
{
"id": "example",
"name": "Example",
"server_id": "123456789",
"status": "queued",
"version": "1.4.2",
"last_seen_at": "2026-07-01T12:00:00.000Z"
}
]
}
],
"network_ids": [
"123456789"
],
"firewall_ids": [
"123456789"
],
"kubeconfig_rotated_at": "2026-07-01T12:00:00.000Z",
"latest_snapshot_at": "2026-07-01T12:00:00.000Z",
"created_at": "2026-07-01T12:00:00.000Z",
"updated_at": "2026-07-01T12:00:00.000Z",
"team_id": "t123",
"metadata": {
"example": "value"
}
}
{
"error": {
"message": "Malformed JSON body.",
"code": "bad_request"
}
}
{
"error": {
"message": "Missing or invalid token.",
"code": "unauthorized"
}
}
{
"error": {
"message": "We require at least one successful credit card transaction before allowing billable actions via the API. This significantly helps us to prevent fraud. Once your first transaction is processed, you will be able to use the API unrestricted. Please add credit to your account at https://betterstack.com/settings/billing/card/new?credits=10&activate_api=true. Need help? We're here for you at hello@betterstack.com.",
"code": "payment_required"
}
}
{
"error": {
"message": "The request could not be completed right now. Please try again in a few moments.",
"code": "internal_error"
}
}
Returns the newly created Kubernetes cluster.
The body isn't valid JSON.
The API token is missing or invalid.
The organization hasn't made its first payment yet, and the request creates a resource we charge for. The code is payment_required. A request that creates a server, load balancer, object cache, database, reserved IP or volume can also return first_purchase. The url in first_purchase opens a page where you make the payment. The resource is created after the payment. The page works until expires_at, 24 hours after the response.
The organization has as many Kubernetes clusters as its quota allows, or the workers would need more servers than its quota allows.
Your API token can't access the team, a network, a firewall or the server type.
The resource's state doesn't allow the request, such as starting a running server or removing a placement group that still has servers.
The request is missing team_id or name, or the version, an IP range or a node pool isn't valid.
We've locked the resource, with the code locked. Every change to a locked resource is refused, and so is a change that involves one.
Too many requests, with the code rate_limited. We limit requests per client IP and per organization, and some costly endpoints have a stricter limit. Wait as long as the Retry-After header says.
An unexpected, temporary error on our side, with the code internal_error. Try again.
Another cluster is being created in the organization at the same time, with the error code concurrent_create_limit. Or we couldn't create the cluster's servers, with the error code orchestration_failed. List your clusters before you send the request again.
The cluster's ID, a UUID.
The cluster's name, up to 255 characters.
The Kubernetes version as major and minor number, such as 1.36. Defaults to the newest version.
The exact Kubernetes build we installed for version, such as v1.37.2+k3s1.
The versions you can upgrade the cluster to now. Holds the next minor version once we offer it.
The state of the cluster's control plane. The cluster is ready when it's running and every node pool has node_count workers that are all ready.
Valid values:provisioning: We're creating the control plane and the workers.running: The control plane works. Check node_pools to see whether the workers are ready.degraded: The control plane or some workers aren't healthy. status_message says which.upgrading: We're upgrading the control plane and then the workers.restoring: We're restoring the control plane from a snapshot.failed: We couldn't create the cluster. status_message says why.destroyed: The cluster is deleted.
What went wrong while creating, scaling or running the cluster, or null.
Where to reach the cluster's Kubernetes API, and from which IP ranges.
The host name of the Kubernetes API.
The port of the Kubernetes API, always 6443. Always 6443.
The IP ranges allowed to reach the cluster's Kubernetes API, as 1 to 50 IPv4 or IPv6 CIDRs.
The IPv4 range for pods.
The IPv4 range for Kubernetes services.
How many workers were ready when we last checked.
How many workers the cluster has now. Each node pool's node_count says how many it should have.
The cluster's node pools, sorted by name, each with its workers. Deleted node pools aren't listed.
The node pool's ID, a UUID.
The node pool's name.
The server type of the workers.
How many workers the node pool should have.
The Kubernetes labels of the workers, as string pairs.
The Kubernetes taints of the workers.
The taint's key.
The taint's value, or null when the taint has none.
What the taint does to pods that don't tolerate it, as in Kubernetes. Possible values: NoSchedule, PreferNoSchedule, NoExecute.
The node pool's state. A node pool that's active can still have workers that aren't ready. Possible values: active, scaling, deleting, destroyed.
Why the node pool has fewer workers than node_count, or null.
How many workers of the node pool are ready.
How a change of size is going while the node pool is scaling, or null otherwise.
The number of workers before the change.
The node_count to reach.
When the change started. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When we expect the change to be done. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The node pool's workers.
The worker's ID.
The worker's name in Kubernetes.
The ID of the server that runs the worker, or null while the worker is queued.
The worker's state. Possible values: queued, provisioning, joining, ready, not_ready, draining, replacing, destroyed.
The Kubernetes version the worker reports.
When we last saw the worker ready. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The IDs of the private networks attached to the cluster. The list is empty while the cluster has no workers. Order doesn't matter.
The IDs of the firewalls attached to the workers. The list is empty while the cluster has no workers. Order doesn't matter.
When the admin credentials of the kubeconfig were first issued or last rotated, or null before they're issued. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When the newest available snapshot of the control plane was created, or null when there is none. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When the cluster was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When the cluster was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The ID of the team that owns the cluster. betterstack team list shows it.
Your own tags, up to 10 string pairs.