What is Cluster.dev?Cluster.dev is an open-source tool designed to manage cloud native infrastructures with simple declarative manifests - stack templates. It allows you to describe an entire infrastructure and deploy it with a single tool.Stack templates can be based on T

erraform modules, Kubernetes manifests, Shell scripts, Helm charts and Argo CD/Flux applications, OPA policies, etc. Cluster.dev brings those components together so that you can deploy, test and distribute a whole set of components with pinned versions.When do I need Cluster.dev?

If you have a common infrastructure pattern that contains multiple components stuck together.

This could be a bunch of TF-modules, or a set of K8s add-ons where you need to re-use this pattern inside your projects.If you develop an infrastructure platform that you ship to other teams and they need to launch new infrastructures from your template.If you build a complex infrastructure that contains different technologies and you need to perform integration testing to confirm the components' interoperability. Once done, you can then promote the changes to next environments.

If you are a software vendor and need to deliver infrastructure deployment along with your software.Base concept diagramsStack templates are composed of units - Lego-like building blocks responsible for passing variables to a particular technology.

Templates define infrastructure patterns or even the whole platform.

In the Examples section you will find ready-to-use Cluster.dev samples that will help you

bootstrap cloud infrastructures. Running the sample code will get you a provisioned Kubernetes cluster with add-ons in the cloud.

The available options include:EKS cluster in AWSK3s cluster in AWSGKE cluster in GCPKubernetes cluster in DigitalOceanDedicated monitoring cluster in AWSLaunching a chat-enabled Hugging Face LLM on top of EKS cluster in AWSY\


ou will also find examples on how to customize the existing templates in order to expand their functionality:Modify AWS-EKS template


Also please check our Medium blogGitOps for Terraform and Helm with Cluster.devBuilding UI for DevOps operations with Cluster.dev and Streamlit

Cluster.dev uses stack templates to generate users' projects in a desired cloud. DO-K8s is a stack template that creates and provisions Kubernetes clusters in the DigitalOcean cloud.On this page you will find guidance on how to create a Kubernetes cluster on DigitalOcean using one of the Cluster.dev prepared samples – the DO-K8s stack template. Running the example code will have the following resources created:DO Kubernetes cluster with addons:cert-managerargocd(optional, if vpc_id is not set) VPC for Kubernetes clusterPrerequisitesTerraform version 1.4+DigitalOcean accountdoctl installedCluster.dev client installedAuthenticationCreate an access token for a user.InfoMake sure to grant the user with administrative permissions.For details on using DO spaces bucket as a backend, see here.DO access configurationInstall doctl. For more information, see the official documentation.cd ~
wget https://github.com/digitalocean/doctl/releases/download/v1.57.0/doctl-1.57.0-linux-amd64.tar.gz
tar xf ~/doctl-1.57.0-linux-amd64.tar.gz
sudo mv ~/doctl /usr/local/bin

Export your DIGITALOCEAN_TOKEN - for details see here.export DIGITALOCEAN_TOKEN="MyDIGITALOCEANToken"
Export SPACES_ACCESS_KEY_ID and SPACES_SECRET_ACCESS_KEY environment variables - for details see here.export SPACES_ACCESS_KEY_ID="dSUGdbJqa6xwJ6Fo8qV2DSksdjh..."
export SPACES_SECRET_ACCESS_KEY="TEaKjdj8DSaJl7EnOdsa..."

Create a spaces bucket for Terraform states in the chosen region (in the example we used the 'cdev-data' bucket name).Create a domain in DigitalOcean domains service.InfoIn the project generated by default we used 'k8s.cluster.dev' zone as an example. Please make sure to change it.Create projectConfigure access to DigitalOcean and export required variables.Create locally a project directory, cd into it and execute the command:  cdev project create https://github.com/shalb/cdev-do-k8s

This will create a new, empty project.Edit variables in the example's files, if necessary:project.yaml - main project config. Sets common global variables for the current project, such as organization, region, state bucket name etc. See project configuration docs.backend.yaml - configures backend for Cluster.dev states (including Terraform states). Uses variables from project.yaml. See backend docs.stack.yaml - describes stack configuration. See stack docs.Run

cdev plan to build the project. In the output you will see an infrastructure that is going to be created after running cdev apply.NotePrior to running cdev apply, make sure to look through the stack.yaml

file and replace the commented fields with real values. In case you would like to use existing VPC and subnets, uncomment preset options and set correct VPC ID and subnets' IDs. If you leave them as is, Cluster.dev will have VPC and subnets created for you.Run cdev applyTipWe highly recommend running cdev apply in a debug mode so that you can see the Cluster.dev logging in the output: cdev


apply -l debug
After cdev apply is successfully executed, in the output you will see the ArgoCD URL of your cluster. Sign in to the console to check whether ArgoCD is up and running and that the stack template has been deployed correctly. To sign in, use the "admin" login and the bcrypted password that you have generated for the stack.yaml.Displayed in the output will also be a command on how to

get kubeconfig and connect to your Kubernetes cluster.Destroy the cluster and all created resources with the command cdev destroy

After cdev apply is successfully

executed, in the output you will see the ArgoCD URL of your cluster. Sign in to the console to check whether ArgoCD is up and running and


that the stack template has been deployed correctly. To sign in, use the "admin" login and the bcrypted password that you have generated for the stack.

yaml
.Displayed in the output will also be a command on how to get kubeconfig and connect to your Kubernetes cluster.Destroy the cluster and all cr