> ## Documentation Index
> Fetch the complete documentation index at: https://www.latitude.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLASTIX

> Setting up managed bare metal nodes in a Kubernetes cluster

In this guide, you'll learn how to configure bare metal servers as Kubernetes worker nodes using the CLASTIX platform.
This setup combines the ease of Managed K8s with the control and performance of dedicated hardware. Let's get started!

You can also use Terraform to set up your K8s cluster. Check our setup guide [here](https://github.com/latitudesh/examples/tree/main/terraform/kubernetes-clastix).

## Requirements

* 2 or more [Latitude.sh](https://www.latitude.sh/) servers
* [Kubectl](https://kubernetes.io/docs/tasks/tools/) installed on your local workstation

## Step 1: Set up your Kubernetes control plane

<Steps>
  <Step title="Access CLASTIX playground">
    Access the [CLASTIX playground](https://console.clastix.cloud/) and log in with your GitHub account.

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-sign-in.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=6d4ac9cb3369c3d75ac542896c816586" alt="CLASTIX sign in" width="1353" height="696" data-path="images/product/clastix-sign-in.png" />
  </Step>

  <Step title="Create your first cluster">
    Click **Create your first cluster**.

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-create-1st-cluster.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=c2347570b65dc097bf7fa092e0f0e77d" alt="Create first CLASTIX cluster" width="1353" height="625" data-path="images/product/clastix-create-1st-cluster.png" />
  </Step>

  <Step title="Configure cluster settings">
    Give the cluster a name and choose the Kubernetes version.

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-cluster-name.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=ae8d337265f3b1c10f902c88255999a7" alt="CLASTIX cluster name" width="1353" height="618" data-path="images/product/clastix-cluster-name.png" />
  </Step>

  <Step title="Select cluster components">
    Select the components CoreDNS, Konnectivity, and kube-proxy, then click **Create**:

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-cluster-components.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=f28de400e2029482a04e11b984d39d1f" alt="CLASTIX cluster components" width="1353" height="618" data-path="images/product/clastix-cluster-components.png" />
  </Step>

  <Step title="Wait for cluster to be ready">
    Wait a few seconds until the status of your Kubernetes Control Plane appears "Ready."

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-cluster-status.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=69041feb25a5b99d7285cffd7bdc637e" alt="CLASTIX cluster status" width="1353" height="618" data-path="images/product/clastix-cluster-status.png" />
  </Step>
</Steps>

## Step 2: Add the bare metal worker nodes

<Steps>
  <Step title="Deploy servers">
    Go to your [Latitude.sh console](https://metal.new/) and deploy two or more servers with **Ubuntu 22.04** or **24.04**.
  </Step>

  <Step title="Access your servers">
    In the server list, click the key icon on the right side of the server row, copy the **login snippet**, and paste it into your terminal to log in.
    For more details, see [our docs](https://www.latitude.sh/docs/servers/deploying-a-server).

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-server-credentials.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=3fafd239d46dbd41b41bd1ab9cbc56fd" alt="CLASTIX server credentials" width="1353" height="445" data-path="images/product/clastix-server-credentials.png" />
  </Step>

  <Step title="Install dependencies">
    After logging in, run the following command to update the package list and install socat and conntrack:

    ```shell theme={null}
    sudo apt update && sudo apt install -y socat conntrack
    ```

    Repeat this process for each server.
  </Step>

  <Step title="Join nodes to cluster">
    From the CLASTIX console, click on your cluster's badge to open details, copy the **Yaki join command** provided, and paste it into your terminal to add the server as a worker node.

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-join-command.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=b7b472822712feede1fdc7c36d84f682" alt="CLASTIX join command" width="1353" height="784" data-path="images/product/clastix-join-command.png" />

    After your machines join the Kubernetes cluster, they will appear in the "List of nodes."

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-nodes-list.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=5b56a1bd919a80a79743126b8b379227" alt="CLASTIX nodes list" width="1353" height="644" data-path="images/product/clastix-nodes-list.png" />
  </Step>
</Steps>

## Step 3: Set up kubeconfig

<Steps>
  <Step title="Download kubeconfig">
    From the CLASTIX console, copy the kubeconfig and save it in a `file clastix-kubeconfig.yaml` on your workstation.
  </Step>

  <Step title="Configure kubectl">
    Set the KUBECONFIG environment variable to point to the location of the kubeconfig file:

    ```shell theme={null}
    export KUBECONFIG=/path/to/clastix-kubeconfig.yaml
    ```
  </Step>
</Steps>

## Step 4: Install networking add-ons

Your worker nodes will appear "Not Ready" until networking is configured. Follow these steps to install a [CNI plugin](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/), such as [Calico](https://github.com/clastix/calico-cni).

<Steps>
  <Step title="Add Calico CNI plugin">
    From the CLASTIX console, add a new add-on for Calico by filling in the necessary fields.

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-cni-plugin.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=803259176c9a99c82197971c20b0859b" alt="CLASTIX CNI plugin" width="1353" height="686" data-path="images/product/clastix-cni-plugin.png" />

    The new add-on is now listed:

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-calico.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=25042a1c6b093ea9668f2b5c1e2b3fdb" alt="CLASTIX Calico" width="1353" height="556" data-path="images/product/clastix-calico.png" />
  </Step>

  <Step title="Wait for nodes to be ready">
    Wait a few moments until your nodes transition to "Ready".

    <img src="https://mintcdn.com/latitudesh/ELzsuRnxGwFWx5KO/images/product/clastix-nodes-ready.png?fit=max&auto=format&n=ELzsuRnxGwFWx5KO&q=85&s=8387fc8dcd9ac09376922e9d5a7da3b8" alt="CLASTIX nodes ready" width="1353" height="556" data-path="images/product/clastix-nodes-ready.png" />
  </Step>
</Steps>

## All set!

Your Kubernetes cluster is now up and running with bare metal nodes, ready for scaling.
To optimize traffic management across your nodes, check out our guide on [Kubernetes load balancing](/guides/kubernetes-load-balancing-on-bare-metal).
