Set up your Bare Metal Kubernetes Cluster

You can deploy Kubernetes clusters on physical machines using the bare metal support for Private Cloud Director. Each cluster contains all the resources for your containerized workloads, such as nodes, pods, and services.

Learn more on how you can onboard physical machines to Private Cloud Director , create a Kubernetes cluster through the Private Cloud Director console, and verify if your cluster is working.

Prerequisites

Before you start, ensure you have:

  • One or more Ubuntu physical machines for your Kubernetes nodes. PCD supports Ubuntu 20.04 LTS and Ubuntu 22.04 LTS.

  • Network connectivity between all machines and the Private Cloud Director management cluster.

  • Administrator requires sudo or root access on all target machines.

  • Valid Private Cloud Director account credentials.

  • Access to your Private Cloud Director management console.

Step 1: Onboard your machines

To install the byohctl CLI and registering your physical machines with Private Cloud Director, perform the following steps.

  1. Download and install byohctl For each physical server you want to add a Kubernetes node, run this command.

bash <(curl -s https://byohctl.s3.us-west-2.amazonaws.com/byohctl-setup)

This command downloads and runs the setup script that installs the byohctl CLI on your machine.

  1. Register your machine with Private Cloud Director Run the following onboard command with your Private Cloud Director credentials:

sudo ./byohctl onboard \
  -u <URL> \
  -e <USERNAME/EMAIL> \
  -d <DOMAIN> \
  -c <CLIENT_TOKEN> \
  -t <TENANT> \
  -r <REGION> \
  -p <PASSWORD>

Replace the placeholder parameter with your actual information.

Parameter
Description
Example

<URL>

Your Private Cloud Director management plane URL

exampl.pcd.platform9.com

<USERNAME/EMAIL>

Your Private Cloud Director username or email address

<DOMAIN>

Your Private Cloud Director domain

default

<CLIENT_TOKEN>

Your Private Cloud Director client token (secret)

MyT0k3N

<TENANT>

Your Private Cloud Director tenant

service

<REGION>

Your Private Cloud Director region

regionone

<PASSWORD>

Your Private Cloud Director password __

your_password

Here is an example of how your command would be.

byohctl onboard -u exampl.pcd.platform9.com -e [email protected] -d default -c MyT0k3N -t service -r regionone -p your_password
  1. Verify successful onboarding

Confirm that your machine has been properly registered with Private Cloud Director and the agent is communicating correctly.

Verify that the agent service is active and communicating by running the following command.

systemctl status pf9-byohost-agent.service

You should see the agent service is active and running.

Review the agent logs to confirm registration with Private Cloud Director by running the following command.

cat /var/log/pf9/byoh/byoh-agent.log

Confirm you see registration success messages in the logs.

From your management cluster, confirm the host is visible as an available resource by running the following command.

kubectl get byohost -A

Your machine should appear in the list of available hosts. You can also verify this on the Private Cloud Director console from Kubernetes > Infrastructure > Physical Hosts.

Step 2: Create your Kubernetes cluster

  1. Log in to your Private Cloud Director console.

  2. Navigate to Infrastructure > Clusters

  3. Select Create New Cluster with Physical Nodes to access Deploy a New Cluster. Enter and choose the compute infrastructure for your new cluster.

Field

Action

Description

Cluster Name

Enter a unique name for your cluster

This name identifies your cluster in the Private Cloud Director console

Physical Node

Select your onboarded machines

Choose from the available hosts list

  1. Choose Control Plane Type: Choose Managed Control Plane and then select Next.

  2. Configure your Kubernetes cluster settings.

Settings

Action

Description

Kubernetes Version

Select from dropdown

Choose the Kubernetes version supported by your workloads.

Kubernetes Flags

Enable this flag

Customize kube-apiserver, Controller Manager, and Scheduler flags using the cluster API.

Core Add-ons

Enable as required

CoreDNS and Calico can be enabled individually. Customize add-ons using cluster API add-on configuration.

Other Add-ons

Enable as required

Optional add-ons like MetalLB and Nvidia GPU Operator are available.

  1. Select Submit to start the deployment process.

The Private Cloud Director console now provisions your cluster using the physical machines you onboarded.

Step 3: Verify your cluster

Monitor cluster creation

Monitor your cluster creation progress in the Private Cloud Director console.

  1. Navigate to Infrastructure > Clusters.

  2. Find your cluster in the list and monitor its status as Active

Optionally, you can also monitor progress using these kubectl commands from your management cluster.

  • Check the TenantControlPlane status by running the following command.

kubectl get tcp -A
  • Check the HostedControlPlane status by running the following command.

kubectl get hcp -A
  • Monitor machine provisioning by running the following command.

kubectl get machine -A

When your machines show Running status with NODENAME and PROVIDERID values, your cluster nodes have successfully joined.

Access your cluster

Download the kubeconfig file from the Private Cloud Director console.

  1. Navigate to Kubernetes > Infrastructure > Clusters and then to your cluster.

  2. Choose Download Kubeconfig.

  3. Save the downloded file as cluster-kubeconfig.yaml.

  • Set your kubectl context by running the following command.

export KUBECONFIG=<CLUSTER_KUBECONFIG.YAML>
  • Verify your cluster is working by running the following command.

kubectl get nodes -A 
kubectl get ns 
kubectl get pods -A

These commands show your cluster nodes, namespaces, and running pods.

You have successfully created and verified your bare metal Kubernetes cluster. Your physical machines are now ready to run containerized workloads.

Info

Cluster Autoscaling is not currently supported in BYOH Kubernetes clusters

Best Practices

  • Make sure your physical machines meet the minimum system requirements for Kubernetes nodes.

  • The byohctl agent logs at /var/log/pf9/byoh/byoh-agent.log are useful for troubleshooting onboarding issues.

  • Core add-ons are required for basic cluster functionality.

  • Your Kubernetes version must be supported by your Private Cloud Director management plane.

Last updated

Was this helpful?