Skip to main content

clusters

Creates, updates, deletes, gets or lists a clusters resource.

Overview

Nameclusters
TypeResource
Idlinode.lke.clusters

Fields

The following fields are returned by SELECT queries:

Returns a single Kubernetes cluster.

NameDatatypeDescription
idintegerRead-only This Kubernetes cluster's unique ID.
subnet_idintegerBeta, LKE Enterprise The ID of the VPC subnet to use for the Kubernetes cluster. This subnet must have both IPv4 and IPv6 enabled (dual-stack). When this field is specified, the cluster is deployed to the given subnet and its corresponding VPC. To specify a VPC and have a subnet auto-allocated, use vpc_id instead. If subnet_id and vpc_id are both unspecified, a new VPC and subnet are auto-allocated for the cluster. > 🚧 > > This field is available as part of the beta API and can only be used with accounts that have been enrolled in the LKE Enterprise LA. Call the URL with the apiVersion path parameter set to v4beta.
vpc_idintegerBeta, LKE Enterprise The ID of the VPC to use for the Kubernetes cluster. An appropriately sized subnet is auto-allocated. To specify an existing subnet, use subnet_id instead. If subnet_id and vpc_id are both unspecified, a new VPC and subnet are auto-allocated for the cluster. > 🚧 > > This field is available as part of the beta API and can only be used with accounts that have been enrolled in the LKE Enterprise LA. Call the URL with the apiVersion path parameter set to v4beta.
apl_enabledbooleanWrite-once Indicates whether the Akamai App Platform is installed during creation of the LKE cluster. It defaults to false. If set to true, control_plane.high_availability also needs to be true. Automatic installation of the App Platform is only possible when creating a new cluster (not when modifying existing clusters).
control_planeobjectDefines settings for the Kubernetes control plane, including enabling High Availability (HA) for the control plane.
createdstring (date-time)Read-only When this Kubernetes cluster was created. (example: 2019-09-12T21:25:30Z)
k8s_versionstringFilterable The desired Kubernetes version for this Kubernetes cluster in the format of <major>.<minor>. The latest supported patch version is deployed. (example: 1.33)
labelstringFilterable This Kubernetes cluster's unique label for display purposes only. Labels have the following constraints: - UTF-8 characters will be returned by the API using escape sequences of their Unicode code points. For example, the Japanese character is 3 bytes in UTF-8 (0xE382AB). Its Unicode code point is 2 bytes (0x30AB). APIv4 supports this character and the API will return it as the escape sequence using six 1 byte characters which represent 2 bytes of Unicode code point ("\u30ab"). - 4 byte UTF-8 characters are not supported. - If the label is entirely composed of UTF-8 characters, the API response will return the code points using up to 193 1 byte characters. (example: lkecluster12345)
regionstringFilterable This Kubernetes cluster's location. (example: us-central)
stack_typestringBeta, LKE Enterprise The networking stack type of the Kubernetes cluster. This specifies that the cluster is IPv4 only (default) or supports both IPv4 and IPv6 (dual-stack). > 🚧 > > This field is available as part of the beta API and can only be used with accounts that have been enrolled in the LKE Enterprise LA. Call the URL with the apiVersion path parameter set to v4beta. (ipv4, ipv4-ipv6) (default: ipv4, example: ipv4)
tagsarrayFilterable An array of tags applied to the Kubernetes cluster. Tags are for organizational purposes only.
tierstringBeta, Filterable The desired Kubernetes tier, either standard or enterprise. > 🚧 > > This field is available as part of the beta API. Call the URL with the apiVersion path parameter set to v4beta. (standard, enterprise) (example: standard)
updatedstring (date-time)Read-only When this Kubernetes cluster was updated. (example: 2019-09-13T21:24:16Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectclusterIdGet a specific Cluster by ID.

Learn more...

Learn more...
listselectLists current Kubernetes clusters available on your account.

Learn more...

Learn more...
createinsertlabel, region, k8s_version, node_poolsCreates a Kubernetes cluster. The Kubernetes cluster will be created asynchronously. You can use the events system to determine when the Kubernetes cluster is ready to use. Please note that it often takes 2-5 minutes before the Kubernetes API endpoints and the Kubeconfig file for the new cluster are ready.

Learn more...

Learn more...
updatereplaceclusterIdUpdates a Kubernetes cluster.

Learn more...

Learn more...
deletedeleteclusterIdDeletes a cluster from your account.

> 🚧
>
> Deleting a cluster is a destructive action and can't be undone.

When a cluster is deleted, all supporting Kubernetes services are removed from your account along with all Linodes in your cluster's node pools. You must have read_write permission to the cluster to initiate deletion.

Some additional services associated with your cluster remain active on your account. These services include NodeBalancers and Block Storage volumes. To avoid further charges, delete these services manually through Cloud Manager, the Linode CLI, or the Linode API.

Learn more...

Learn more...
recycleexecclusterIdRecycles all nodes in all pools of a designated Kubernetes Cluster. All Linodes within the Cluster will be deleted and replaced with new Linodes on a rolling basis, which may take several minutes. Replacement Nodes are installed with the latest available patch version for the Cluster's current Kubernetes minor release.

Any local storage on deleted Linodes (such as hostPath and emptyDir volumes, or local PersistentVolumes) will be erased.

Learn more...

Learn more...
regenerateexecclusterIdRegenerate the Kubeconfig file and/or the service account token for a Cluster.

This is a helper operation that allows performing both the Delete a Kubeconfig and the Delete a service token operations with a single request.

When using this operation, at least one of kubeconfig or servicetoken is required.

> 📘
>
> When regenerating a service account token, the cluster's control plane components and Linode CSI drivers are also restarted and configured with the new token. High availability clusters shouldn't experience any disruption, while standard clusters may experience brief control plane downtime while components are restarted.

Learn more...

Learn more...
delete_service_tokenexecclusterIdDelete and regenerate the service account token for a Cluster.

> 📘
>
> When you regenerate a service account token, the cluster's control plane components and Linode CSI drivers are also restarted and configured with the new token. High availability clusters shouldn't experience any disruption, while standard clusters may experience brief control plane downtime while components are restarted.

Learn more...

Learn more...

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
clusterIdstringID of the target Kubernetes cluster. (example: {{clusterId}})

SELECT examples

Get a specific Cluster by ID.

Learn more...

Learn more...

SELECT
id,
subnet_id,
vpc_id,
apl_enabled,
control_plane,
created,
k8s_version,
label,
region,
stack_type,
tags,
tier,
updated
FROM linode.lke.clusters
WHERE clusterId = '{{ clusterId }}' -- required
;

INSERT examples

Creates a Kubernetes cluster. The Kubernetes cluster will be created asynchronously. You can use the events system to determine when the Kubernetes cluster is ready to use. Please note that it often takes 2-5 minutes before the Kubernetes API endpoints and the Kubeconfig file for the new cluster are ready.

Learn more...

Learn more...

INSERT INTO linode.lke.clusters (
apl_enabled,
control_plane,
k8s_version,
label,
node_pools,
region,
stack_type,
subnet_id,
tags,
tier,
vpc_id
)
SELECT
{{ apl_enabled }},
'{{ control_plane }}',
'{{ k8s_version }}' /* required */,
'{{ label }}' /* required */,
'{{ node_pools }}' /* required */,
'{{ region }}' /* required */,
'{{ stack_type }}',
{{ subnet_id }},
'{{ tags }}',
'{{ tier }}',
{{ vpc_id }}
RETURNING
id,
subnet_id,
vpc_id,
apl_enabled,
control_plane,
created,
k8s_version,
label,
region,
stack_type,
tags,
tier,
updated
;

REPLACE examples

Updates a Kubernetes cluster.

Learn more...

Learn more...

REPLACE linode.lke.clusters
SET
control_plane = '{{ control_plane }}',
k8s_version = '{{ k8s_version }}',
label = '{{ label }}',
tags = '{{ tags }}'
WHERE
clusterId = '{{ clusterId }}' --required
RETURNING
id,
subnet_id,
vpc_id,
apl_enabled,
control_plane,
created,
k8s_version,
label,
region,
stack_type,
tags,
tier,
updated;

DELETE examples

Deletes a cluster from your account.

> 🚧
>
> Deleting a cluster is a destructive action and can't be undone.

When a cluster is deleted, all supporting Kubernetes services are removed from your account along with all Linodes in your cluster's node pools. You must have read_write permission to the cluster to initiate deletion.

Some additional services associated with your cluster remain active on your account. These services include NodeBalancers and Block Storage volumes. To avoid further charges, delete these services manually through Cloud Manager, the Linode CLI, or the Linode API.

Learn more...

Learn more...

DELETE FROM linode.lke.clusters
WHERE clusterId = '{{ clusterId }}' --required
;

Lifecycle Methods

Recycles all nodes in all pools of a designated Kubernetes Cluster. All Linodes within the Cluster will be deleted and replaced with new Linodes on a rolling basis, which may take several minutes. Replacement Nodes are installed with the latest available patch version for the Cluster's current Kubernetes minor release.

Any local storage on deleted Linodes (such as hostPath and emptyDir volumes, or local PersistentVolumes) will be erased.

Learn more...

Learn more...

EXEC linode.lke.clusters.recycle
@clusterId='{{ clusterId }}' --required
;