Skip to content

Latest commit

 

History

History
109 lines (70 loc) · 3.08 KB

File metadata and controls

109 lines (70 loc) · 3.08 KB

DevZero Self-Hosted - Terraform Setup

This document provides a step-by-step guide for setting up the infrastructure required to self-host the DevZero Control Plane and Data Plane using Terraform. The infrastructure can be deployed on cloud platforms like AWS, GCP, and Azure.

Pre-reading

For readers experienced with Terraform deployments at their companies, we have some examples under ./examples that you can reference to see how to run a full DevZero deployment. If you have your own terraform environment and want to reuse our modules, you can refer to the ./modules directory to use whichever components you need.

Overview

The terraform/ directory contains Infrastructure as Code (IaC) configurations that automate the provisioning of essential cloud resources such as VPCs, EKS clusters, load balancers, and VPNs.

Prerequisites

Tools Required

  • Terraform (for managing infrastructure as code)
  • AWS CLI (for interacting with AWS resources)
  • Access credentials for your cloud provider (AWS/GCP/Azure)

Permissions Required

Ensure your IAM user or role has sufficient permissions to create resources like VPCs, subnets, EKS clusters, ALBs, and VPNs.

Infrastructure Setup Guide

1. Clone the Repository

git clone https://github.com/devzero-inc/self-hosted.git

2. Navigate to the Base Cluster Directory

cd self-hosted/terraform/examples/aws/base-cluster

3. Configure Terraform Variables

Using an Existing VPC

  • Open the terraform.tfvars file.
  • Update the VPC ID and subnet IDs.
  • Set create_vpc = false to prevent Terraform from creating a new VPC.

Let Terraform Create a New VPC

  • Skip the above step.
  • Ensure create_vpc = true (default setting).

Cluster Endpoint Access

  • Set cluster_endpoint_public_access = true to allow public access.
  • Set it to false for private access.

4. Initialise and Apply Terraform

terraform init
terraform apply
  • This will create AWS resources such as VPC, EKS, ALB, VPN, etc.
  • Copy the output values like cluster name, VPC ID, and subnet IDs for the next steps.

Extending the Cluster

5. Navigate to the Cluster Extensions Directory

cd ../cluster-extensions

6. Update terraform.tfvars

  • Add the VPC ID, subnet IDs, region, and EKS cluster name from the previous step.

7. Apply Terraform for Add-ons and Storage

terraform init
terraform apply
  • This will create EKS Add-ons, Storage Classes, and EFS.

Post-Deployment Steps

8. Update kubeconfig

aws eks update-kubeconfig --region <region> --name <cluster-name>

9. Apply the Kata RuntimeClass

cd ../../../kata
kubectl apply -f runtimeclass.yaml

10. Install DevZero Self-Hosted

Refer to the Charts README for further steps to deploy the Control Plane and Data Plane.

Troubleshooting

  • Verify cloud credentials and permissions.
  • Check Terraform state files for resource management.
  • Use terraform plan to preview changes before applying.