Deploy your Cloudspace via CLI
Spot CLI (spotctl) BETA
The Spot CLI (spotctl) lets you manage Rackspace Spot resources from your terminal using a valid API token from the dashboard. It supports full CRUD for Cloudspaces, Node Pools (Spot and On-Demand), and helpful discovery commands for regions, organizations, server classes, and pricing.
When to use spotctl
- Day‑to‑day management of Cloudspaces and node pools
- Non-interactive automation and scripts
- Quickly fetching kubeconfigs to use with
kubectl(see: Access your Cloudspace via kubectl)
1. Installation
Download the binary from Github
Download from: Github Releases then move the binary to a directory in your PATH, for example
sudo mv spotctl /usr/local/bin/spotctl --version- Authenticate and Configure
1) In the Rackspace Spot Dashboard, navigate to API Access and generate a token.
2) Run the interactive configuration wizard:
spotctl configure3) Non-interactive configuration (example):
# Example environment variables commonly used in CI/scriptsexport SPOT_ORG="<organization-name>"export SPOT_REGION="<region>"export SPOT_REFRESH_TOKEN="<refresh-token>"Notes:
- You must provide organization name, region, and a valid refresh token from the dashboard.
- Tokens can expire or be revoked; reconfigure if authentication fails.
3. Quickstart
Create a Cloudspace
Using the interactive deployment wizard:
spotctl cloudspaces createUsing a config file:
spotctl cloudspaces create --config my-cluster-config.yamlCommand line arguments:
spotctl cloudspaces create --name <cloudspace-name> --region <region-name> --org <org-name> --spot-nodepool "serverclass=gp.vs1.medium-ord,desired=1,bidprice=0.09"Get kubeconfig
spotctl cloudspaces get-config <cloudspace-name> --file ~/.kube/config-<cloudspace-name>Then follow: Access your Cloudspace via kubectl
spotctl Command Reference
Authentication
spotctl configure– interactive setup
Cloudspaces
spotctl cloudspaces listspotctl cloudspaces get <name>spotctl cloudspaces create [--config file | flags]spotctl cloudspaces delete <name>spotctl cloudspaces get-config <name> [--file <path>]
Node Pools – Spot
# Createspotctl nodepools spot create \ --name spot-workers \ --namespace <org> \ --cloudspace <cloudspace> \ --server-class gp.vs1.medium-iad \ --desired 5 \ --bid-price 0.85# List / Getspotctl nodepools spot list --namespace <org>spotctl nodepools spot get --name <pool-name># Update / Deletespotctl nodepools spot update --name <pool-name> --cloudspace <cloudspace> --desired 2 --bid-price 0.08spotctl nodepools spot delete --name <pool-name>Node Pools – On‑Demand
# Createspotctl nodepools ondemand create \ --name critical-workers \ --namespace <org> \ --cloudspace <cloudspace> \ --serverclass mem.vs1.large-iad \ --desired 3# List / Getspotctl nodepools ondemand list --namespace <org>spotctl nodepools ondemand get --name <pool-name># Update / Deletespotctl nodepools ondemand update --name <pool-name> --cloudspace <cloudspace> --desired 2spotctl nodepools ondemand delete --name <pool-name>Discovery
- Server Classes:
spotctl serverclasses list,spotctl serverclasses get <name> - Regions:
spotctl regions list,spotctl regions get <name> - Organizations:
spotctl organizations list,spotctl organizations get <id> - Pricing:
spotctl pricing get <serverclass>
Output Formats
spotctl supports multiple output formats:
| Format | Description | Example |
|---|---|---|
| JSON | Structured JSON (default) | spotctl regions list --output json |
| Table | Human‑readable table | spotctl serverclasses list --output table |
| YAML | YAML formatted | spotctl organizations list --output yaml |
Examples
# Spot node pool lifecyclespotctl nodepools spot create --name <id> --cloudspace <cs> --desired 1 --serverclass gp.vs1.medium-ord --bidprice 0.08spotctl nodepools spot update --name <id> --cloudspace <cs> --desired 2 --bidprice 0.08spotctl nodepools spot get --name <id>spotctl nodepools spot delete --name <id># On‑Demand node pool lifecyclespotctl nodepools ondemand create --name <id> --cloudspace <cs> --desired 1 --serverclass gp.vs1.medium-ordspotctl nodepools ondemand update --name <id> --cloudspace <cs> --desired 2spotctl nodepools ondemand get --name <id>spotctl nodepools ondemand delete --name <id>Tips & Troubleshooting
- Authentication failed: Re‑run
spotctl configurewith a fresh dashboard token. - Missing org/region: Provide
--org/--regionor set environment variables before invoking commands. - Kubeconfig rotation: If your downloaded kubeconfig expires, regenerate with
spotctl cloudspaces get-config. - Output for automation: Use
--output jsonand parse withjqin scripts.