Prerequisites
- Terraform installed
- NPM installed
- A Clastix Cloud Tenant Control Plane with a join token command string
- A Latitude.sh account with an API key
Important notes
- Ensure you have correctly provisioned a Tenant Control Plane on Clastix Cloud Console as this Terraform plan does not create it. Make sure you have the join token command string from the console.
- The default configuration creates 3 worker nodes to join the Tenant Control Plane and form your baremetal Kubernetes cluster. Adjust the
node_count
variable if you need a different number of nodes.
1
Download the example files
Download the example files using degit:
2
Initialize Terraform
bash terraform init
3
Update variables
Update the
variables.tf
file with your specific details:-
JOIN_URL
: The URL of Tenant Control Plane to join. Find this on the Clastix Cloud Console. -
JOIN_TOKEN
: The token to join the Tenant Control Plane. Find this on the Clastix Cloud Console. You will be asked for it when planning and applying your plan. -
JOIN_TOKEN_CACERT_HASH
: The CA certificate hash of the token. Find this on the Clastix Cloud Console. You will be asked for it when planning and applying your plan. -
LATITUDESH_AUTH_TOKEN
: Don’t hardcode this. You will be asked for it when planning and applying your plan. -
project_id
: The ID of the project you want to deploy to. Find this from the home page in the console. -
plan
: The plan slug. For example, for the m4.metal.medium, usem4-metal-medium
-
region
: The slug of the location you want to deploy to. E.g., for Dallas useDAL
. Find all with the api.latitude.sh/locations endpoint. -
ssh_key_id
: The ID of the SSH key you want to use for the nodes. Find this in the console under Project settings > SSH keys -
private_key_path
: This script will access your servers during setup. Add the local path in your computer where the private key of the SSH Key inserted above. -
server_count
: Optional. Number of nodes to provision and add to the cluster.
4
Review configuration
(Optional) Modify other variables in
variables.tf
as needed:project_id
: Your Latitude project IDregion
: The region where you want to deploy the clusterplan
: The server plan for the nodesnode_count
: The number of worker nodes (default is 3)
main.tf
file if necessary.5
Plan your Terraform execution
bash terraform plan
6
Apply the changes
If the plan looks good, apply the changes:Confirm by typing
yes
when prompted.