Skip to content

stakwork/workspaces

Repository files navigation

Workspace Management System

A cloud-native workspace management system deployed using Terraform and Kubernetes.

Project Overview

This project provides infrastructure as code (IaC) and deployment automation for a workspace management system. It includes:

  • Infrastructure provisioning using Terraform
  • Kubernetes cluster deployment
  • Workspace controller for managing workspaces
  • Port detection and management
  • Domain configuration and ingress management

Prerequisites

  • AWS CLI configured with appropriate credentials
  • Terraform installed
  • Kubernetes CLI (kubectl) installed
  • PowerShell 5.1 or higher

Environment Configuration

The project uses environment variables loaded from a .env file. Create a copy of .env.example and modify it with your specific values:

cp .env.example .env

The .env file should contain:

  • AWS credentials
  • Domain configuration
  • Other deployment-specific variables

Deployment

Using PowerShell (Windows)

./deploy.ps1

Using Bash (Linux/Mac)

./deploy.sh

or

bash deploy.sh

The deployment script:

  1. Loads environment variables from .env
  2. Replaces placeholders in Kubernetes configuration files
  3. Sets up AWS credentials
  4. Deploys the infrastructure and workloads

Destruction

To destroy the infrastructure provisioned by Terraform, navigate to the terraform folder and run the following commands:

cd terraform
terraform destroy

Destruction scripts

bash aws_cleanup.sh

This script Helm release and perfoms terraform destroy

Manual Cleanup (Optional)

If you want to quickly set up your infrastructure again, you can manually delete some resources on the AWS console. This is optional, but it can save you time in the long run.

To manually clean up resources on AWS:

  1. Log in to the AWS Management Console.
  2. Go to the IAM dashboard and:
    • Delete users created by Terraform.
    • Delete roles created by Terraform.
    • Delete policies created by Terraform.
  3. Go to the S3 dashboard and delete the bucket(s) created by Terraform.
  4. Go to the CloudFormation dashboard and delete the stack(s) created by Terraform.

Note: Be careful when deleting resources on AWS, as this will permanently remove them. Make sure you only delete resources that were created by Terraform.

Project Structure

.
├── .env                # Environment variables
├── .env.example        # Example environment variables
├── deploy.ps1          # PowerShell deployment script
├── deploy.sh           # Bash deployment script
├── docs/               # Documentation
├── kubernetes/         # Kubernetes manifests
│   ├── base/          # Base Kubernetes configuration
│   ├── cert-manager/  # Certificate management
│   ├── config/        # Configuration files
│   ├── port_detector/ # Port detection service
│   ├── scripts/       # Kubernetes deployment scripts
│   ├── storage/       # Storage configuration
│   └── workspace_controller/ # Workspace management controller
├── terraform/         # Terraform infrastructure code
└── .terraform/        # Terraform state and cache

Security

  • AWS credentials are managed through environment variables
  • Sensitive values should be stored in environment variables
  • .env file is gitignored for security

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •