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

  1. 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
  1. 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.


3. Quickstart

Create a Cloudspace

Using the interactive deployment wizard:

spotctl cloudspaces create

Using a config file:

spotctl cloudspaces create --config my-cluster-config.yaml
cloudspace:
name: <name>
org: <org>
region: <region>
kubernetesVersion: "1.31.1"
cni: calico

spotnodepools:
- serverClass: gp.vs1.large-ord
desired: 1
bidPrice: "0.05"

ondemandnodepools:
- serverClass: gp.vs1.large-ord
desired: 1

Command 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 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>
  • 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 with jq in scripts.

Related Docs