System Architecture
The platform consists of three main components working together:Core Components
1. React Frontend
Modern single-page application built with:- React 19 with TypeScript
- Vite 7 for fast development and optimized builds
- TanStack Query 5 for server state management
- React Router 7 for client-side routing
- React Hook Form + Zod for form validation
- Tailwind CSS 4 for styling
- Recharts for metrics visualization
- Dashboard with deployment cards
- Team management (create, invite, manage members)
- Secrets management (three-tier: user/template/deployment)
- Template creation with YAML spec editor
- Real-time deployment logs and metrics
- Billing and subscription management
k8s-scheduler/ui/
2. Go Server
REST API backend serving both the API and embedded React application:- OAuth Authentication: Google OAuth2 flow
- Session Management: Memory/PostgreSQL/Redis backends
- Embedded SPA: React app served via
go:embed - RBAC Middleware: Permission checks on all endpoints
- Template Management: CRUD with visibility scopes
- Deployment Lifecycle: Create/delete/monitor deployments
- Secrets Management: Three-tier secrets architecture
- Billing Integration: Stripe subscriptions and webhooks
k8s-scheduler/cmd/server/
Key API endpoints:
3. Kubernetes Operator
Kubernetes operator built with controller-runtime:- Watches:
UserDeploymentcustom resources - Reconciles: Creates/updates/deletes K8s resources
- Manages: Deployments, Services, Ingresses, ConfigMaps, ExternalSecrets
- Features: Health probes, resource limits, Prometheus metrics
k8s-scheduler/cmd/operator/
Custom Resource Definition:
k8s-scheduler/manifests/userdeployment-crd.yaml
Data Flow
Understanding how a deployment is created:1
User Action
User clicks Create Deployment in the React UI, fills out the form with template selection and configuration.
2
API Request
React app sends POST request to
/api/deployments with deployment configuration.3
Server Validation
Go server validates the request, checks RBAC permissions, and verifies the user has quota available for their subscription tier.
4
Create Custom Resource
Server creates a
UserDeployment custom resource in Kubernetes:internal/server/server.go
5
Operator Watches
Operator’s controller watches for new
UserDeployment resources and triggers reconciliation loop.6
Reconcile Loop
Operator creates all necessary Kubernetes resources:
- Deployments (one per service in the template)
- Services (for internal networking)
- Ingresses (for external access)
- ExternalSecrets (to sync secrets from Vault)
- ConfigMaps (for user configuration)
- NetworkPolicies (for tenant isolation)
7
Pods Running
Kubernetes schedules pods, pulls images, mounts secrets, and starts containers.
8
Status Updates
Operator updates the
UserDeployment status field with pod health, URLs, and any errors. React UI polls for updates and displays deployment status.Multi-Tenancy Model
Shipyard implements a hierarchical multi-tenancy model:RBAC Hierarchy
Every user action is validated against their role at the organization and team level.
Implementation:
k8s-scheduler/internal/authz/authorizer.go
Secrets Architecture
Three-tier secrets system for flexible secret management:Secret Levels
Implementation:
k8s-scheduler/internal/secrets/vault.go
Infrastructure Components
Shipyard consists of three main repository components:1. k8s-scheduler
Main application code (React frontend + Go backend + Kubernetes operator) Tech stack:- Go 1.24 with standard library HTTP server
- PostgreSQL (pgx/v5) for data persistence
- controller-runtime for Kubernetes operator
- React 19 + Vite 7 + TailwindCSS 4
2. terraform-modules
Reusable Terraform modules for AWS infrastructure:- VPC: Virtual private cloud with public/private subnets
- EKS: Amazon EKS cluster with managed node groups
- RDS: PostgreSQL database
- Vault: HashiCorp Vault infrastructure (KMS, DynamoDB)
- EC2: Bastion hosts and utility instances
- State: S3 + DynamoDB for Terraform state
terraform-modules/
3. infra
Environment-specific infrastructure deployments using the Terraform modules. Three-layer architecture:- Infrastructure Layer: VPC, EKS, Tailscale VPN, Vault
- Platform Layer: ALB Controller, cert-manager, External Secrets Operator
- Apps Layer: ArgoCD, Traefik, application TLS certificates
infra/terraform/dev/
Subscription Tiers
Feature availability varies by subscription tier:
Enforcement:
k8s-scheduler/internal/tierlimits/
Next Steps
Quick Start
Get Shipyard running locally in minutes
K8s Scheduler
Multi-tenant deployment platform
Terraform Modules
Reusable infrastructure modules
Infrastructure Guide
Deploy the full stack on AWS