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)
Quickstart
Prerequisites
- Go 1.16+
Option 1: Download the binary from the releases page
Download from: Github Releases then move the binary to a directory in your PATH, for example
sudo mv spotctl /usr/local/bin/
spotctl --version
Option 2: Install using Go COMING SOON
go install github.com/rackspace-spot/spotctl@latest
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 configure
3) Non-interactive configuration (example):
# Example environment variables commonly used in CI/scripts
export 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.
Quickstart
List Cloudspaces
spotctl cloudspaces list
Create a Cloudspace
Interactive:
Quick flags:
spotctl cloudspaces create --name my-cluster --region us-east-1
Using a config file:
spotctl cloudspaces create --config my-cluster-config.yaml
Command line arguments (JSON):
spotctl cloudspaces create \
--name <name> \
--region <region> \
--org <org> \
--spot-nodepool '{"desired":1,"serverclass":"gp.vs1.medium-ord","bidprice":0.08}' \
--ondemand-nodepool '{"desired":1,"serverclass":"gp.vs1.medium-ord"}'
Command line arguments (comma-separated):
spotctl cloudspaces create \
--name <name> \
--region <region> \
--org <org> \
--spot-nodepool desired=1,serverclass=gp.vs1.medium-ord,bidprice=0.08 \
--ondemand-nodepool desired=1,serverclass=gp.vs1.medium-ord
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 list
spotctl cloudspaces get <name>
spotctl cloudspaces create [--config file | flags]
spotctl cloudspaces delete <name>
spotctl cloudspaces get-config <name> [--file <path>]
Node Pools – Spot
# Create
spotctl nodepools spot create \
--name spot-workers \
--namespace <org> \
--cloudspace <cloudspace> \
--server-class gp.vs1.medium-iad \
--desired 5 \
--bid-price 0.85
# List / Get
spotctl nodepools spot list --namespace <org>
spotctl nodepools spot get --name <pool-name>
# Update / Delete
spotctl nodepools spot update --name <pool-name> --cloudspace <cloudspace> --desired 2 --bid-price 0.08
spotctl nodepools spot delete --name <pool-name>
Node Pools – On‑Demand
# Create
spotctl nodepools ondemand create \
--name critical-workers \
--namespace <org> \
--cloudspace <cloudspace> \
--serverclass mem.vs1.large-iad \
--desired 3
# List / Get
spotctl nodepools ondemand list --namespace <org>
spotctl nodepools ondemand get --name <pool-name>
# Update / Delete
spotctl nodepools ondemand update --name <pool-name> --cloudspace <cloudspace> --desired 2
spotctl 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 lifecycle
spotctl nodepools spot create --name <id> --cloudspace <cs> --desired 1 --serverclass gp.vs1.medium-ord --bidprice 0.08
spotctl nodepools spot update --name <id> --cloudspace <cs> --desired 2 --bidprice 0.08
spotctl nodepools spot get --name <id>
spotctl nodepools spot delete --name <id>
# On‑Demand node pool lifecycle
spotctl nodepools ondemand create --name <id> --cloudspace <cs> --desired 1 --serverclass gp.vs1.medium-ord
spotctl nodepools ondemand update --name <id> --cloudspace <cs> --desired 2
spotctl nodepools ondemand get --name <id>
spotctl nodepools ondemand delete --name <id>
Tips & Troubleshooting
- Authentication failed: Re‑run
spotctl configure
with a fresh dashboard token. - Missing org/region: Provide
--org
/--region
or set environment variables before invoking commands. - Kubeconfig rotation: If your downloaded kubeconfig expires, regenerate with
spotctl cloudspaces get-config
. - Output for automation: Use
--output json
and parse withjq
in scripts.