Production-ready automation for deploying enterprise-grade Coder development environments on Scaleway Kubernetes, featuring 20+ workspace templates, comprehensive CI/CD workflows, and AI-enhanced development with Claude Code Flow integration.
Before deploying Coder on Scaleway, ensure you have the following:
- Create an account at scaleway.com
- Generate API keys in the Scaleway Console
- Note your Project and Organization IDs from the
Install the following tools on your local machine:
# Install all required tools
brew install terraform kubectl helm jq curl
# Alternative: Install specific versions
brew install terraform@1.12
brew install kubernetes-cli@1.32
brew install helm@3.12# Update package index
sudo apt-get update
# Install basic tools
sudo apt-get install -y curl jq git
# Install Terraform
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# Install Helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash# Install basic tools
sudo yum install -y curl jq git
# Install Terraform
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum -y install terraform
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# Install Helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash# Using Chocolatey
choco install terraform kubernetes-cli kubernetes-helm jq curl git
# Using Scoop
scoop install terraform kubectl helm jq curl git# Check all tools are installed with correct versions
terraform version # Must be >= 1.12.0
kubectl version --client # Must be >= 1.32.0
helm version # Must be >= 3.12.0
jq --version # Any recent version
curl --version # Any recent version
git --version # Any recent versionSet up your Scaleway credentials:
# Required credentials
export SCW_ACCESS_KEY="your-scaleway-access-key"
export SCW_SECRET_KEY="your-scaleway-secret-key"
export SCW_DEFAULT_PROJECT_ID="your-project-id"
export SCW_DEFAULT_ORGANIZATION_ID="your-organization-id"
# Optional: Set default region (defaults to fr-par)
export SCW_DEFAULT_REGION="fr-par"
export SCW_DEFAULT_ZONE="fr-par-1"
# Save to your shell profile for persistence
echo 'export SCW_ACCESS_KEY="your-scaleway-access-key"' >> ~/.bashrc
echo 'export SCW_SECRET_KEY="your-scaleway-secret-key"' >> ~/.bashrc
echo 'export SCW_DEFAULT_PROJECT_ID="your-project-id"' >> ~/.bashrc
echo 'export SCW_DEFAULT_ORGANIZATION_ID="your-organization-id"' >> ~/.bashrcIf you plan to use GitHub Actions for deployment:
# macOS
brew install gh
# Ubuntu/Debian
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt install gh
# RHEL/CentOS/Fedora
sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf install gh
# Windows
choco install gh # Chocolatey
scoop install gh # Scoop
# Authenticate with GitHub
gh auth loginOnce everything is installed, verify your setup:
# Clone the repository
git clone https://github.com/your-org/bootstrap-coder-on-scaleway.git
cd bootstrap-coder-on-scaleway
# Run prerequisite check
./scripts/test-runner.sh --suite=prerequisitesFor automatic staging deployments via GitHub Actions:
Repository Secret Configuration:
# In your GitHub repository settings, add this secret:
ENABLE_AUTO_STAGING_DEPLOY=true # Enables automatic staging deployment on push/PRNote: This is a feature flag that controls continuous deployment. Set to true only when you want automatic deployments enabled. When not set or set to any other value, automatic deployments are disabled while manual deployments continue to work.
Important: Ensure you've completed all Prerequisites before proceeding.
This project uses a two-phase deployment strategy for better reliability and troubleshooting:
- Phase 1 (Infrastructure): Deploy Kubernetes cluster, database, networking, and security
- Phase 2 (Coder Application): Deploy the Coder platform with workspace templates
Benefits: Infrastructure failures don't block cluster access, better separation of concerns, independent retry capability, and immediate kubeconfig access for troubleshooting.
Deploy your first Coder environment in minutes:
# 1. Verify prerequisites are met
./scripts/test-runner.sh --suite=prerequisites
# 2. Deploy complete environment (both phases automatically)
./scripts/lifecycle/setup.sh --env=dev --template=python-django-crewai
# π Your Coder instance will be available at the provided URL
# π‘ First deployment takes ~10-15 minutesDeploy using GitHub Actions with automated two-phase workflow:
# Prerequisites: GitHub CLI (gh) must be installed
# Fork the repository and configure secrets
gh repo fork pacphi/bootstrap-coder-on-scaleway
gh secret set SCW_ACCESS_KEY --body "your-access-key"
gh secret set SCW_SECRET_KEY --body "your-secret-key"
gh secret set SCW_DEFAULT_PROJECT_ID --body "your-project-id"
gh secret set SCW_DEFAULT_ORGANIZATION_ID --body "your-organziation-id"
# Deploy complete environment (both phases)
gh workflow run deploy-environment.yml \
-f environment=dev \
-f template=python-django-crewai \
-f enable_monitoring=true
# Or deploy infrastructure only for troubleshooting
gh workflow run deploy-infrastructure.yml \
-f environment=dev
# Monitor deployment progress
gh run watchPhase 1 - Infrastructure Deployment (~10 min):
- β Kubernetes cluster creation with auto-scaling
- β Managed PostgreSQL database provisioning
- β VPC networking and security groups
- β Load balancer and SSL configuration
- β Kubeconfig uploaded for immediate cluster access
Phase 2 - Coder Application Deployment (~5 min):
- β Coder platform installation and configuration
- β OAuth integration and user management
- β Workspace template deployment (if specified)
- β Final health checks and validation
Key Advantage: If Phase 2 fails, you still have full cluster access via kubeconfig to troubleshoot and retry Coder deployment independently.
| Environment | Monthly Cost | Use Case | Resources |
|---|---|---|---|
| Development | β¬53.70 | Personal dev, learning | 2ΓGP1-XS nodes, DB-DEV-S |
| Staging | β¬97.85 | Team testing, CI/CD | 3ΓGP1-S nodes, DB-GP-S |
| Production | β¬374.50 | Enterprise, high availability | 5ΓGP1-M nodes, DB-GP-M HA |
Java Spring, Python Django+CrewAI, Go Fiber, Ruby Rails, PHP Symfony, Rust Actix Web, .NET Core
React+TypeScript, Angular, Vue+Nuxt, Svelte Kit
Claude Code Flow Base/Enterprise with 87 MCP tools, swarm/hive-mind modes
Docker Compose, Kubernetes+Helm, Terraform+Ansible
Jupyter+Python, R Studio
Flutter, React Native, Ionic
- π Usage Guide - Complete usage examples, GitHub Actions workflows, and troubleshooting
- ποΈ Architecture Guide - System design, components, CI/CD flows, and Mermaid diagrams
- π― Templates Guide - Comprehensive listing of all 21+ workspace templates with usage examples
- π€ AI Assistant Context - Technical context for Claude Code integration and new capabilities
- π Integrations Guide - External integrations setup (Slack, JIRA, monitoring, compliance)
- π§ Hooks Framework - Extensible automation and integration examples
- π§ͺ Testing Guide - Comprehensive validation and testing procedures
- π Cost Management - Real-time cost tracking and optimization
Complete Environment Deployment (Recommended):
# Deploy both infrastructure and Coder application
gh workflow run deploy-environment.yml \
-f environment=staging \
-f template=react-typescript \
-f enable_monitoring=truePhase-Specific Deployments:
# Deploy infrastructure only (Phase 1)
gh workflow run deploy-infrastructure.yml \
-f environment=dev \
-f region=fr-par
# Deploy Coder application only (Phase 2) - requires existing infrastructure
gh workflow run deploy-coder.yml \
-f environment=dev \
-f template=python-django-crewai# Complete teardown (both phases)
gh workflow run teardown-environment.yml \
-f environment=dev \
-f confirmation="I understand this will destroy the environment" \
-f create_backup=true
# Selective teardown options
gh workflow run teardown-environment.yml \
-f environment=dev \
-f teardown_mode=coder_only # Keep infrastructure, remove Coder only# Validate all templates and infrastructure
gh workflow run validate-templates.yml \
-f validation_scope=comprehensive \
-f test_deployments=true# Run all validation tests
./scripts/test-runner.sh --suite=all
# Run specific test suites
./scripts/test-runner.sh --suite=smoke,templates --format=json
# Test external integrations
./scripts/test-runner.sh --suite=integrations# Quick health check
./scripts/validate.sh --env=prod --quick
# Comprehensive validation with detailed report
./scripts/validate.sh --env=staging --comprehensive --format=json# Scale cluster with cost analysis
./scripts/scale.sh --env=prod --nodes=8 --analyze-cost
# Auto-scale based on workload
./scripts/scale.sh --env=staging --auto --target-cpu=70# Complete environment backup
./scripts/lifecycle/backup.sh --env=prod --include-all
# Pre-destroy backup with retention
./scripts/lifecycle/backup.sh --env=staging --pre-destroy --retention-days=90# Customize deployment lifecycle
./scripts/hooks/pre-setup.sh # Before deployment starts
./scripts/hooks/post-setup.sh # After deployment completes
./scripts/hooks/pre-teardown.sh # Before teardown starts
./scripts/hooks/post-teardown.sh # After teardown completes- Slack notifications for deployment events
- JIRA ticket creation for environment changes
- External monitoring system registration
- Compliance checks and audit logging
- User notifications and workspace management
π Complete Integration Setup Guide - Detailed documentation for configuring all external integrations
- Multi-environment deployment with cost optimization (dev/staging/prod)
- GitHub Actions CI/CD with automated workflows and notifications
- Terraform automation with state management and drift detection
- Kubernetes management on Scaleway Kapsule with auto-scaling
- Extensible hooks framework for custom deployment logic
- 21+ production-ready templates across all major frameworks
- AI-enhanced development with Claude Code Flow integration (87 MCP tools)
- Dynamic template discovery with automatic validation
- Multi-language support (Java, Python, Go, Rust, JS/TS, C#, PHP, Ruby)
- Specialized templates for data science, DevOps, and mobile development
- Enterprise security with Pod Security Standards and RBAC
- Network policies and traffic isolation
- Encrypted secrets management with Kubernetes
- Audit logging and compliance tracking
- Environment-specific security policies (dev/staging/prod)
- Cost management with real-time tracking and budget alerts
- Comprehensive monitoring with Prometheus/Grafana stacks
- Health checks and automated validation
- Performance metrics and resource optimization
- External system integration (Slack, monitoring, etc.)
- Automated backups with configurable retention policies
- Disaster recovery procedures with point-in-time restoration
- Pre-destroy backups to prevent data loss
- Multi-format exports (infrastructure, configs, data)
- Backup verification and integrity checks
- Dynamic cluster scaling with cost analysis
- Auto-scaling policies based on CPU/memory metrics
- Resource quotas and limit enforcement
- Load balancing with SSL termination
- Performance optimization recommendations
β Security: Pod Security Standards, Network Policies, RBAC, encrypted secrets β Monitoring: Prometheus metrics, Grafana dashboards, alerting β Compliance: Audit logging, cost tracking, resource quotas β Scalability: Auto-scaling nodes (3-15), high availability database β Reliability: Automated backups, disaster recovery, health checks
# 1. Deploy development environment with AI template (two-phase automatic)
./scripts/lifecycle/setup.sh --env=dev --template=claude-flow-base
# 2. Validate deployment
./scripts/validate.sh --env=dev --quick
# 3. Scale for team development
./scripts/scale.sh --env=dev --nodes=4
# 4. Create backup before major changes
./scripts/lifecycle/backup.sh --env=dev --include-workspaces
# 5. Run comprehensive tests
./scripts/test-runner.sh --suite=integration --env=dev# Deploy production with all enterprise features (two-phase automatic)
./scripts/lifecycle/setup.sh \
--env=prod \
--template=java-spring \
--enable-monitoring \
--enable-ha \
--cost-budget=400
# Validate production readiness
./scripts/validate.sh --env=prod --comprehensive
# Set up automated scaling
./scripts/scale.sh --env=prod --auto --min-nodes=5 --max-nodes=15# If Coder deployment fails, infrastructure is still accessible:
# 1. Use kubeconfig from Phase 1 to investigate
export KUBECONFIG=~/.kube/config-coder-dev
kubectl get pods -n coder
kubectl describe deployment coder -n coder
# 2. Retry only Coder deployment (Phase 2)
gh workflow run deploy-coder.yml -f environment=dev
# 3. Or use manual deployment for Phase 2
cd environments/dev/coder
terraform init && terraform apply# GitHub Actions example - Two-Phase Deployment
name: Deploy Staging on PR
on:
pull_request:
types: [opened, synchronize]
jobs:
deploy-staging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy complete environment (two-phase)
uses: ./.github/workflows/deploy-environment.yml
with:
environment: staging
template: react-typescript
enable_monitoring: true
auto_approve: trueThe two-phase architecture organizes environments with separate configurations:
environments/
βββ dev/
β βββ infra/ # Phase 1: Infrastructure (cluster, database, networking)
β β βββ main.tf
β β βββ providers.tf
β β βββ outputs.tf
β βββ coder/ # Phase 2: Coder application deployment
β βββ main.tf
β βββ providers.tf
β βββ outputs.tf
βββ staging/
β βββ infra/
β βββ coder/
βββ prod/
βββ infra/
βββ coder/
Prerequisites Missing
# Check system requirements
./scripts/test-runner.sh --suite=prerequisitesTemplate Deployment Fails
# Validate templates
./scripts/test-runner.sh --suite=templates
# Check template syntax
gh workflow run validate-templates.yml -f validation_scope=syntaxTwo-Phase Deployment Issues
# Infrastructure deployment failed (Phase 1)
# Check Scaleway console and workflow logs
gh run list --workflow=deploy-infrastructure.yml
# Coder deployment failed (Phase 2) - Infrastructure still accessible
# Use kubeconfig to troubleshoot
export KUBECONFIG=~/.kube/config-coder-<env>
kubectl get storageclass # Check if scw-bssd storage class exists
kubectl get pvc -n coder # Check persistent volume claims
# Retry only Coder deployment
gh workflow run deploy-coder.yml -f environment=<env>Cost Overruns
# Analyze current costs
./scripts/utils/cost-calculator.sh --env=all --detailed
# Set budget alerts
./scripts/utils/cost-calculator.sh --env=prod --set-budget=300 --alert-threshold=80Scaling Issues
# Check cluster capacity
./scripts/validate.sh --env=prod --focus=resources
# Analyze scaling recommendations
./scripts/scale.sh --env=prod --analyze-only- Usage Guide - Comprehensive documentation
- GitHub Issues - Bug reports and feature requests
- Architecture Guide - System design and troubleshooting
- Hooks Examples - Custom integration patterns
We welcome contributions! Please see our Contributing Guidelines and check out open issues.
# Fork and clone the repository
gh repo fork your-org/bootstrap-coder-on-scaleway
cd bootstrap-coder-on-scaleway
# Run comprehensive tests
./scripts/test-runner.sh --suite=all
# Deploy test environment
./scripts/lifecycle/setup.sh --env=dev --template=python-django-crewaiMIT License - see LICENSE for details.
π Ready to get started? Choose your deployment method:
- Quick Start:
./scripts/lifecycle/setup.sh --env=dev --template=react-typescript - GitHub Actions:
gh workflow run deploy-environment.yml - Comprehensive Setup: Check the Usage Guide
Need help? Check the documentation or create an issue π