Attach a network to a Kubernetes cluster
Attach a private network to the cluster. We attach it shortly after the response.
The ID of the Kubernetes cluster to attach.
Bearer $TOKEN
application/json
The ID of the private network to attach.
{
"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": "This token is read-only and cannot be used for write operations.",
"code": "read_only_token"
}
}
{
"error": {
"message": "Resource not found.",
"code": "not_found"
}
}
{
"error": {
"message": "The request could not be completed right now. Please try again in a few moments.",
"code": "internal_error"
}
}
Returns the 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 request would go over a quota, with the code quota_exceeded. Or a read-only token tried to make a change, with the code read_only_token. Or a rule of the resource forbids it.
The resource doesn't exist, it's in another zone, or your token can't access it.
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 network's range overlaps pod_cidr or service_cidr.
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.
The zone has no capacity, with the code no_capacity. Or we couldn't set up or change the resource, with the code orchestration_failed. Or the organization is creating too many resources at the same time, with the code concurrent_create_limit. Try again after a short wait.
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.