Skip to content

feat: add BetterUp deployment infrastructure for Langflow#1

Open
ryanclark2 wants to merge 1 commit intomainfrom
betterup/deployment-setup
Open

feat: add BetterUp deployment infrastructure for Langflow#1
ryanclark2 wants to merge 1 commit intomainfrom
betterup/deployment-setup

Conversation

@ryanclark2
Copy link

Summary

Add comprehensive Kubernetes deployment and CI/CD infrastructure for deploying Langflow in BetterUp's AWS/EKS environment following established infrastructure patterns.

🚀 Key Features

Complete Helm Chart - Deployment, Service, HPA, PDB, Secrets
CI/CD Pipeline - ECR builds, chart packaging, automated deployment
Production Container - Security-hardened Dockerfile with PostgreSQL support
Environment Support - Dev, staging, production configurations
Security - Non-root containers, resource limits, health checks
Documentation - Comprehensive deployment guide and troubleshooting

🏗️ Infrastructure Components

Kubernetes Deployment

  • Helm Chart: /release/kubernetes/langflow/ following identity-service patterns
  • Templates: Deployment, Service, HPA, PDB, Secrets with proper labels
  • Values: Environment-specific configurations for dev/staging/production
  • Security: Security contexts, resource limits, non-root execution

CI/CD Workflows

  • Build Pipeline: build_and_push_staging_image.yml - Docker → ECR
  • Deployment: staging_cd.yml - Orchestrates build → package → deploy
  • Chart Management: Helm chart packaging and OCI registry storage
  • Testing: Docker build validation and Python test suite

Production Container

  • Base: Python 3.11 slim with security hardening
  • Database: Built-in PostgreSQL support via langflow[postgresql]
  • User: Non-root execution (1000:1000) for security
  • Health Checks: HTTP endpoint monitoring for Kubernetes

🔧 Environment Configuration

Development (us-east-1-dev)

  • Single replica, reduced resources for cost optimization
  • Debug logging enabled for development workflow
  • Automatic deployment from main branch

Staging/Production (Future)

  • Multi-replica setup with read replicas
  • Enhanced monitoring and alerting
  • Production-grade resource allocation

🗄️ Database Integration

  • RDS PostgreSQL: Managed via betterup-infrastructure repository
  • Connection: AWS Secrets Manager for credential management
  • Security: VPC security groups, SSL required
  • Scaling: Read replicas for production environments

📋 Repository Changes

  • ✅ Add release/kubernetes/langflow/ - Complete Helm chart
  • ✅ Add .github/workflows/ - CI/CD following BetterUp patterns
  • ✅ Add Dockerfile.production - Production-optimized container
  • ✅ Add DEPLOYMENT.md - Comprehensive documentation
  • ✅ Remove docker_example/ - Replaced with production setup

🧪 Test Plan

  • Deploy infrastructure via betterup-infrastructure PR feat: Add IBM Watsonx Model Component langflow-ai/langflow#3373
  • Create ECR repository: betterup-langflow-us-east-1
  • Set up IAM role: gha-langflow-us-east-1
  • Configure GitHub environment secrets
  • Test build pipeline and deployment to staging
  • Verify database connectivity and application functionality

🔗 Related PRs

🤖 Generated with Claude Code

Add comprehensive Kubernetes deployment and CI/CD setup for deploying Langflow in BetterUp infrastructure.

## 🚀 Kubernetes Deployment
- **Helm Chart**: Complete chart with Deployment, Service, HPA, PDB, Secrets
- **Security**: Non-root containers, security contexts, resource limits
- **Scaling**: Horizontal Pod Autoscaler with CPU-based scaling
- **Health Checks**: Liveness and readiness probes for reliability
- **Environment Values**: Dev-specific configuration with staging/prod ready

## 🔄 CI/CD Pipeline
- **Build Workflow**: Docker image build and push to ECR
- **Deployment Pipeline**: Helm chart packaging and Kubernetes deployment
- **Test Suite**: Python tests and Docker build validation
- **Environment Promotion**: Automated dev/staging, manual production

## 🐳 Production Container
- **Multi-stage Build**: Optimized for security and size
- **PostgreSQL Ready**: Built-in database connectivity with langflow[postgresql]
- **Security**: Non-root user (1000:1000), minimal attack surface
- **Health Checks**: Built-in HTTP health endpoint monitoring

## 🏗️ Infrastructure Integration
- **ECR**: Container registry for betterup-langflow-us-east-1
- **EKS**: Kubernetes deployment with proper service accounts
- **RDS**: PostgreSQL database (managed via betterup-infrastructure)
- **IAM**: Service account with AWS role integration
- **Secrets**: Database credentials via AWS Secrets Manager

## 📁 Repository Changes
- Add `release/kubernetes/langflow/` - Complete Helm chart
- Add `.github/workflows/` - CI/CD workflows following BetterUp patterns
- Add `Dockerfile.production` - Production-optimized container
- Add `DEPLOYMENT.md` - Comprehensive deployment documentation
- Remove `docker_example/` - Replaced with production setup

## 🔧 Environment Support
- **Dev (us-east-1-dev)**: Single replica, reduced resources, debug logging
- **Staging**: Multi-replica, production-like setup (future)
- **Production**: High-availability configuration (future)

## 📚 Documentation
- **DEPLOYMENT.md**: Complete deployment guide with troubleshooting
- **Architecture Diagrams**: GitOps workflow and component overview
- **Environment Configuration**: Detailed setup for each environment

## ⚡ Next Steps
1. Deploy infrastructure from betterup-infrastructure PR langflow-ai#3373
2. Create ECR repository and configure IAM roles
3. Set up GitHub Actions secrets and environments
4. Test deployment pipeline in dev environment

This follows established BetterUp patterns from identity-service and lighthouse deployments.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the enhancement New feature or request label Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant