Documentation
Nov-2025
Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Deploy your Cloudspace via Terraform
Copy Markdown
Open in ChatGPT
Open in Claude
Rackspace Spot allows you to create and operate your Cloudspaces via Terraform, using a dedicated Terraform provider.
The Spot Terraform Provider
The Spot Terraform provider is available via the official Terraform registry:
https://registry.terraform.io/providers/rackerlabs/spot/latest
Obtain the Access Token from the Spot User Interface
To get started, log in to your Rackspace Spot account, select the Organization you will operate within, and obtain the Terraform Access Token:
- Navigate to the Terraform menu under API Access on the sidebar
- Copy the Access Token provided on that page
- Please note that these Access Tokens provide access to your account and must be stored securely
- Set the token inside provider configuration as shown in the example below
The Access Token doesn't currently include a refresh mechanism.
Using the Terraform Provider
The following example uses the Terraform variable, token, which can be provided from .tfvars file or environment variable.
Terraform (main.tf)
x
54
54
1
terraform {2
required_providers {3
spot = {4
source = "rackerlabs/spot"5
}6
}7
}8
9
variable "rackspace_spot_token" {10
description = "Rackspace Spot authentication token"11
type = string12
sensitive = true13
}14
15
provider "spot" {16
token = var.rackspace_spot_token17
}18
19
# Example of cloudspace resource.20
resource "spot_cloudspace" "example" {21
cloudspace_name = "name-of-the-cloudspace"22
# You can find the available region names in the `regions` data source.23
region = "us-central-dfw-1"24
hacontrol_plane = false25
preemption_webhook = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"26
wait_until_ready = true27
kubernetes_version = "1.31.1"28
cni = "calico"29
}30
31
# Creates a spot node pool with an autoscaling pool of 3-8 servers of class gp.vs1.large-dfw.32
resource "spot_spotnodepool" "autoscaling-bid" {33
cloudspace_name = resource.spot_cloudspace.example.cloudspace_name34
# You can find the available server classes in the `serverclasses` data source.35
server_class = "gp.vs1.large-dfw"36
bid_price = 0.01237
38
autoscaling = {39
min_nodes = 340
max_nodes = 841
}42
43
labels = {44
"managed-by" = "terraform"45
}46
}47
48
data "spot_kubeconfig" "example" {49
cloudspace_name = resource.spot_cloudspace.example.name50
}51
52
output "kubeconfig" {53
value = data.spot_kubeconfig.example.raw54
}Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Last updated on
Was this page helpful?
Next to read:
Deploy your Cloudspace via CLI© 2023 RACKSPACE TECHNOLOGY
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message