Design Platform

Overview

In this first part of the Kubestack tutorial you will:

  1. Decide if you want to bootstrap using UI or CLI
  2. Configure your platform's environments, clusters, node pools and services
  3. Scaffold your Kubestack repository

Deciding between UI and CLI

You can either bootstrap your platform repository following the UI or CLI approach. Both ways are fully supported. The main difference is, that the UI guides you through designing a full featured Kubernetes platform and then generates the Terraform code for you. While the CLI approach only scaffolds a basic, single cluster repository for you.

Using the UI

The easiest way to get a new Kubestack repository is to use the Kubestack Cloud wizard, and then export your platform stack to Terraform code. Using the UI, you can conveniently design multi-cluster or even multi-cloud platforms, choose between the two different infrastructure environment approaches and also configure instance types, node pools and cluster services.

To design your Kubernetes platform stack, launch Kubestack Cloud and follow the three step wizard.

Launch Kubestack Cloud

Select architecture template

Kubestack Framework Overview

First, select one of the architecture templates. Architecture templates make it easy to get started with single or multi-cluster platforms on a single or even across multiple cloud providers.

Define infrastructure environments

Kubestack Framework Overview

Then define your infrastructure environments. Infrastructure environments control if prod and non-prod workloads share clusters or a split onto separate clusters.

Configure platform clusters

Kubestack Framework Overview

Finally, configure some foundational settings, like the base domain to use. Customize the infrastructure environment names if you prefer. And last but not least, configure the base configuration of your clusters.

Export to Terraform

Kubestack Framework Overview

Once you're happy with your custom Kubernetes platform, export it to Terraform, extract the archive and open a shell inside the directory.

Then continue with provisioning your infrastructure >>

Using the CLI

First, download the kbst command line client for your operating system. The CLI is your typical single binary Go application.

You can follow the command line instructions below or download the latest version from the GitHub releases directly.

  1. Download the latest release

    # Download the latest release
    curl -LO "https://github.com/kbst/kbst/releases/download/$(curl -s https://www.kubestack.com/cli-latest.txt)/kbst_linux_amd64.zip"
  2. Extract the archive and place kbst in your PATH

    # Extract the binary into your PATH e.g. /usr/local/bin
    sudo unzip -d /usr/local/bin/ kbst_linux_amd64.zip kbst
  3. Verify the binary works

    # Verify the binary works
    kbst --version
  1. Download the latest release

    # Download the latest release
    curl -LO "https://github.com/kbst/kbst/releases/download/$(curl -s https://www.kubestack.com/cli-latest.txt)/kbst_darwin_amd64.zip"
  2. Extract the archive and place kbst in your PATH

    # Extract the binary into your PATH e.g. /usr/local/bin
    sudo unzip -d /usr/local/bin/ kbst_darwin_amd64.zip kbst
  3. Verify the binary works

    # Verify the binary works
    kbst --version

Windows instructions require WSL2 and Docker Desktop for Windows with the WSL2 backend.

  1. Download the latest release

    # Download the latest release
    curl -LO "https://github.com/kbst/kbst/releases/download/$(curl -s https://www.kubestack.com/cli-latest.txt)/kbst_linux_amd64.zip"
  2. Extract the archive and place kbst in your PATH

    # Extract the binary into your PATH e.g. /usr/local/bin
    sudo unzip -d /usr/local/bin/ kbst_linux_amd64.zip kbst
  3. Verify the binary works

    # Verify the binary works
    kbst --version

Scaffold your repository

Now, use the CLI to scaffold your local repository. Select the tab for your desired Kubestack starter below.

You can easily add more clusters in different regions, on different cloud providers or both later. But for now pick one cloud and let's get started.

# Use the kbst CLI to scaffold your repository using the EKS starter
kbst repo init eks
# Change into the starter directory
cd kubestack-starter-eks
# Use the kbst CLI to scaffold your repository using the AKS starter
kbst repo init aks
# Change into the starter directory
cd kubestack-starter-aks
# Use the kbst CLI to scaffold your repository using the GKE starter
kbst repo init gke
# Change into the starter directory
cd kubestack-starter-gke

Edit the configuration

Follow the steps below to configure your cluster.

  1. eks_zero_cluster.tf

    Set the required variables for apps. Optionally, overwrite settings for ops. By default, the configuration from apps is inherited.

    • name_prefix (required)
    • base_domain (required)
    • cluster_availability_zones (required)
  2. eks_zero_providers.tf

    Set the region attribute of the AWS provider to your desired region.

Edit the file aks_zero_cluster.tf and set the required variables for apps. Optionally, overwrite settings for ops. By default, the configuration from apps is inherited.

  • name_prefix (required)
  • base_domain (required)
  • resource_group (required)

Edit the file gke_zero_cluster.tf and set the required variables for apps. Optionally, overwrite settings for ops. By default, the configuration from apps is inherited.

  • project_id (required)
  • name_prefix (required)
  • base_domain (required)
  • region (required)
  • cluster_node_locations (required)

Commit the configuration

# Commit the configuration
git add .
git commit -m "Add cluster configuration"

Next

Let's continue the tutorial and start automating real cloud infrastructure.