Prerequisites
- Python 3.x and
pip3installed - A Linode API Token with Read/Write access (create one in the Linode Cloud Manager)
Make sure your API token includes
lke:read_write scopes to manage clusters.1. Install the Linode CLI
- Verify
pip3is available: - Install the Linode CLI package:
- Confirm the installation:
2. Configure the CLI
Authenticate the CLI with your token:--token, the CLI launches a browser flow to log in and prompts for region and default Linode type.
3. List Your LKE Clusters
Retrieve all existing Kubernetes clusters on your account:[].
4. Create a New LKE Cluster
Uselinode-cli lke clusters-create with the following flags:
| Flag | Description | Example |
|---|---|---|
--label | Unique name for the cluster | mycluster-01 |
--region | Data center region (e.g., us-central) | us-central |
--k8s-version | Kubernetes version (e.g., 1.23) | 1.23 |
--node-pools | Comma-separated pool definitions | type=g6-standard-4,count=3 |
If you see an error like
Must be unique, update --label to a name not already in use.5. Delete an LKE Cluster
When you no longer need a cluster, remove it with:Deleting a cluster is irreversible and will remove all associated resources.
CLI Command Reference
| Command | Description |
|---|---|
linode-cli lke clusters-list | List all LKE clusters |
linode-cli lke clusters-create | Create a new Kubernetes cluster |
linode-cli lke clusters-delete <label> | Delete a cluster by label |