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.
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.32)
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)
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 in beta and only works when using the beta API. Call the URL with the apiVersion path parameter set to v4beta. (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
get_lke_clusterselectGet a specific Cluster by ID.

Learn more...

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

Learn more...

Learn more...
post_lke_clusterinsertdata__label, data__region, data__k8s_version, data__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...
put_lke_clusterreplaceUpdates a Kubernetes cluster.

Learn more...

Learn more...
delete_lke_clusterdeleteDeletes a Cluster you have permission to read_write.

Deleting a Cluster is a destructive action and cannot be undone.

Deleting a Cluster:

- Deletes all Linodes in all pools within this Kubernetes cluster
- Deletes all supporting Kubernetes services for this Kubernetes cluster (API server, etcd, etc)
- Deletes all NodeBalancers created by this Kubernetes cluster
- Does not delete any of the volumes created by this Kubernetes cluster

Learn more...

Learn more...
post_lke_cluster_recycleexecRecycles 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...
post_lke_cluster_regenerateexecRegenerate 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_lke_service_tokenexecDelete 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

SELECT examples

Get a specific Cluster by ID.

Learn more...

Learn more...

SELECT
id,
apl_enabled,
control_plane,
created,
k8s_version,
label,
region,
tags,
tier,
updated
FROM linode.lke.clusters;

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 (
data__apl_enabled,
data__control_plane,
data__k8s_version,
data__label,
data__node_pools,
data__region,
data__tags,
data__tier
)
SELECT
{{ apl_enabled }},
'{{ control_plane }}',
'{{ k8s_version }}' --required,
'{{ label }}' --required,
'{{ node_pools }}' --required,
'{{ region }}' --required,
'{{ tags }}',
'{{ tier }}'
RETURNING
id,
apl_enabled,
control_plane,
created,
k8s_version,
label,
region,
tags,
tier,
updated
;

REPLACE examples

Updates a Kubernetes cluster.

Learn more...

Learn more...

REPLACE linode.lke.clusters
SET
data__control_plane = '{{ control_plane }}',
data__k8s_version = '{{ k8s_version }}',
data__label = '{{ label }}',
data__tags = '{{ tags }}'
WHERE

RETURNING
created,
k8s_version,
label,
region,
tags,
updated;

DELETE examples

Deletes a Cluster you have permission to read_write.

Deleting a Cluster is a destructive action and cannot be undone.

Deleting a Cluster:

- Deletes all Linodes in all pools within this Kubernetes cluster
- Deletes all supporting Kubernetes services for this Kubernetes cluster (API server, etcd, etc)
- Deletes all NodeBalancers created by this Kubernetes cluster
- Does not delete any of the volumes created by this Kubernetes cluster

Learn more...

Learn more...

DELETE FROM linode.lke.clusters;

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.post_lke_cluster_recycle 
;