A cloud-native workspace management system deployed using Terraform and Kubernetes.
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
- AWS CLI configured with appropriate credentials
- Terraform installed
- Kubernetes CLI (kubectl) installed
- PowerShell 5.1 or higher
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
./deploy.ps1
./deploy.sh
or
bash deploy.sh
The deployment script:
- Loads environment variables from
.env
- Replaces placeholders in Kubernetes configuration files
- Sets up AWS credentials
- Deploys the infrastructure and workloads
To destroy the infrastructure provisioned by Terraform, navigate to the terraform
folder and run the following commands:
cd terraform
terraform destroy
bash aws_cleanup.sh
This script Helm release and perfoms terraform destroy
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:
- Log in to the AWS Management Console.
- Go to the IAM dashboard and:
- Delete users created by Terraform.
- Delete roles created by Terraform.
- Delete policies created by Terraform.
- Go to the S3 dashboard and delete the bucket(s) created by Terraform.
- 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.
.
├── .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
- AWS credentials are managed through environment variables
- Sensitive values should be stored in environment variables
.env
file is gitignored for security