Build, Manage and Operate modern applications with ConfigHub
In this repo you will find example apps for ConfigHub. All of the apps are based on the ConfigHub "Global App" pattern which enables a set of microservice components to be deployed across stages and regions, and then kept in operation.
You should consider everything here to be experimental -- we are seeking your feedback on the application model and deployment flow. Our aspiration is that production grade apps are easy to build and deploy anywhere, using this model, then easily cloned, customised, combined or otherwise adapted simply by operating on configurations.
In addition we are experimenting with combinations of ConfigHub's automation model and AI agents -- towards AI Native Ops.
Our main tools are:
- ConfigHub to manage configurations, custom versions, and operational changes
- Kubernetes for continuously running, event-driven and stateful applications
- Claude AI for intelligent decision-making agents
- Canonical patterns from ConfigHub's global-app reference and SDK
DevOps operations such as deployment, change management, cost tracking, and drift detection have traditionally been implemented as scripts or ephemeral workflows that run and exit. This project demonstrates an alternative approach using persistent Kubernetes applications with ConfigHub as the configuration backend.
DevOps as Apps treats automation as first-class applications with:
- ✅ Persistent execution - Run continuously, not just when triggered
- ✅ Event-driven - React immediately using Kubernetes informers
- ✅ AI-powered - Claude integration for intelligent decisions
- ✅ Stateful - Full history and audit trail in ConfigHub
- ✅ Multi-environment - Dev → staging → prod with push-upgrade
- ✅ Observable - Built-in dashboards and metrics
- ✅ Maintainable - Standard K8s deployment, versioning, rollback
Aspect | DevOps as Apps |
---|---|
Architecture | Persistent applications |
State | ConfigHub-backed state |
Events | Real-time informers |
AI | Claude integration |
Environments | Push-upgrade propagation |
Rollback | Revision history |
Cost | Open source + ConfigHub |
This approach provides continuous monitoring and automated operations using ConfigHub as the configuration backend.
# 1. Install prerequisites
brew install confighubai/tap/cub # ConfigHub CLI
cub auth login # Authenticate
kind create cluster --name devops-test # Or use existing cluster
# 2. Pick an example (see https://github.com/monadic/devops-examples)
cd devops-examples/drift-detector/ # or cost-optimizer/
# 3. Deploy via ConfigHub
bin/install-base # Create ConfigHub structure
bin/setup-worker # Install ConfigHub worker
bin/apply-base # Deploy to Kubernetes
bin/test-workflow # Validate everything works
# 4. See the app in action
kubectl get all -n devops-apps # Check deployment
# Then follow the README in each example
- DevOps Examples Repository - Find our current 'devops as apps' examples here
- Drift Detector - Auto-correct configuration drift
- Cost Optimizer - AI-powered cost reduction
- Cost Impact Monitor - Pre-deployment cost analysis
Note that drift detection is a common use case in DevOps when declarative tools are used. ConfigHub supports multiple scenarios for this, including integration with standard 3rd party GitOps tools. However in this example we show how, for simple "dev" cases, drift can be observed directly and remedied using config updates.
- DevOps Examples Repository - Production examples of DevOps as Apps
- drift-detector, cost-optimizer, cost-impact-monitor
- TraderX Repository - Full production deployment (8 microservices, 4 environments)
- Complete ConfigHub deployment of FINOS TraderX trading platform
- Demonstrates all 12 canonical patterns with comprehensive testing and documentation
Continuous drift detection with auto-correction:
cd devops-examples/drift-detector/
bin/install-base # Create ConfigHub structure
bin/setup-worker # Install worker
bin/apply-base # Deploy to Kubernetes
# Deploy test workloads with drift
bin/deploy-test --with-drift
# Watch auto-correction
kubectl logs -n devops-apps -l app=drift-detector --follow
What it shows:
- ConfigHub Sets and Filters for targeting
- Worker-based deployment via
cub unit apply
- Push-upgrade for multi-environment fixes
- Claude AI drift pattern analysis
- Real-time dashboard on :8080
See the drift-detector README for full guide.
AI-powered cost optimization:
cd devops-examples/cost-optimizer/
bin/install-base # Create ConfigHub structure
bin/setup-worker # Install worker
bin/apply-base # Deploy to Kubernetes
# View AI recommendations
kubectl port-forward -n cost-optimizer svc/cost-optimizer 8081:8081
# Open http://localhost:8081
What it shows:
- Claude AI cost recommendations
- Worker-based deployment workflow
- OpenCost integration for accurate billing
- Real-time dashboard on :8081
- Metrics server integration
See the cost-optimizer README for full guide.
ConfigHub's "global app" example illustrates the main features of a ConfigHub app.
- Unique Project Naming -
cub space new-prefix
prevents collisions - Space Hierarchy - base → qa → staging → prod with upstream/downstream
- Filter Creation - SQL-like WHERE clauses for targeting units
- Environment Cloning - Clone units with
--upstream-unit
relationships - Version Promotion - Set versions with
cub run set-image-reference
- Bulk Operations with Sets - Group related units for bulk operations
- Event-Driven Architecture - React immediately with Kubernetes informers
- ConfigHub Functions -
cub run
for common operations (version, env vars, resources) - Changesets - Atomic multi-unit operations with lock/unlock
- Lateral Promotion - Conservative region-by-region rollout bypassing hierarchy
- Revision Management - List, diff, rollback with full history
- Link Management - Connect app units to infrastructure units
Every app follows this standardized structure:
app-name/
├── README.md # Architecture and features
├── bin/
│ ├── install-base # Create ConfigHub structure
│ ├── setup-worker # Install ConfigHub worker
│ ├── apply-base # Set targets and apply units
│ ├── test-workflow # Validate deployment
│ ├── install-envs # Set up env hierarchy (optional)
│ ├── apply-all # Deploy to specific env (optional)
│ ├── promote # Push-upgrade pattern (optional)
│ └── proj # Get project name
├── confighub/
│ └── base/
│ ├── namespace.yaml # K8s namespace unit
│ ├── deployment.yaml # App deployment unit
│ ├── service.yaml # Service unit
│ └── rbac.yaml # RBAC unit
├── main.go # Application code
└── go.mod # Go module
Deployment flow:
bin/install-base
- Create spaces, filters, and units in ConfigHubbin/setup-worker
- Install worker that executescub unit apply
bin/apply-base
- Set targets and deploy to Kubernetesbin/test-workflow
- Validate everything works
- Canonical Patterns Summary - A deeper explanation of the principles of ConfigHub apps
- ConfigHub Deployment Pattern - How to deploy apps via ConfigHub
- ConfigHub SDK extension libary - some SDK addons
- ConfigHub Actual Features - API notes (created by Claude)
This repository contains the core documentation for the ConfigHub pattern. The examples are in a separate repo: monadic/devops-examples.
- ConfigHub account - Sign up at confighub.com
- ConfigHub CLI (cub) -
brew install confighubai/tap/cub
- Kubernetes cluster - Kind, Minikube, or any K8s 1.19+
- kubectl - Configured for your cluster
- Go 1.21+ - For local development
- Claude API key - For AI features (get one)
- OpenCost - For accurate cloud billing (cost-optimizer example)
See monadic/devops-sdk for the Go SDK used by all examples, and confighub/sdk for the main ConfigHub SDK.
- ConfigHub: docs.confighub.com
- Claude API: docs.anthropic.com
- Kubernetes: kubernetes.io/docs
- Examples: See each example's Troubleshooting section
To add a new DevOps app example:
- Copy structure from drift-detector, cost-optimizer, or TraderX
- Follow the global-app README pattern
- Follow ConfigHub patterns from CANONICAL-PATTERNS-SUMMARY.md
- Consider scenario tasks with verification steps
- Implement comprehensive testing and documentation
See individual examples for licensing details.