Overview

This walkthrough offers a hands-on guide to creating your first Kubox cluster. During the process, it will provision AWS cloud resources, including a Virtual Private Network (VPC), Subnets, Routing Tables, Load Balancer, Virtual Machines (using Spot Instances by default), and more. Successfully completing this guide will verify your permissions, and the final step will clean up all resources, ensuring no residual costs.

Steps

1

Verify AWS CLI is configured and authenticated

If you are new to AWS cloud and need to configure the AWS CLI see Set up an AWS account and create a User

Verify the current context and identity

aws sts get-caller-identity
2

Create a cluster configuration file

The cluster configuration file defines the metadata and the type of virtual machines and their role in the Kubernetes cluster. The role can be one of the three control-plane, worker and gpu.

Region: Please change the aws region in the cluster.yaml as required.

#!/bin/bash

# Define the name of the YAML file
output_file="cluster.yaml"

# Use cat <<EOF to write YAML content to the file
cat <<EOF > "$output_file"
metadata:
  clusterName: hello-world
  pulumi:
    orgName: kubox-ai
    projectName: koala

tags:
  - key: "Environment"
    value: "dev"

aws:
  region: "ap-southeast-2"
  nodes:
    - vmType: t2.medium
      count: 1
      role: control-plane
    - vmType: t2.medium
      count: 2
      role: worker
EOF

# Output a success message
echo "YAML file '$output_file' created successfully."
3

Initialise a cluster folder

The command will create a folder with core helm charts and Kubernetes manifests that will be installed.

After the command has you completed you can inspect the folder ./cluster in the current directory.

kubox init -f cluster.yaml
4

Create the cluster

Time: The cluster creation process take about 3-7 minutes depending depending on spot instance requests.

This command will create the AWS resources including Virtual Machines and bootstrap etcd and Kubernetes.

kubox create -f cluster.yaml

Flux will be installed with default toolkit components. However, Flux is not bootstrapped and a sync with Git is not established.

If you have get errors during creation see troubleshooting guide.

5

Verify cluster

A kubeconfig file will be generated as part of the cluster creation process.

ls ./cluster/config

Connect to the kubernetes cluster using kubectl

kubectl get nodes --kubeconfig ./cluster/config/kubeconfig
6

Delete cluster

kubox delete -f cluster.yaml 

Next