Step 6: Deploy to Production
Step 6: Deploy to Production
Your DevOps agent is complete. It has:
- β An intelligent agent that diagnoses infrastructure problems
- β Tools for health checks, metrics, and restarts
- β Channels for webhooks (alerts, GitHub, Slack)
- β Triggers that auto-react to events
- β Durable workflows with approval gates
Time to deploy it to production so it runs 24/7.
Step 1: Set Up Environment Variables
Create a .env.local file (for local development):
# Required: Your AI providerOPENAI_API_KEY=sk-...
# Optional: Slack integrationSLACK_BOT_TOKEN=xoxb-...SLACK_SIGNING_SECRET=...
# Optional: For Render API restartsRENDER_API_KEY=rnd_...These will also need to be added on Kernova Cloud.
Step 2: Update the Config
Make sure kernova.config.ts is production-ready:
import { defineConfig } from '@kernova/framework';
export default defineConfig({ name: 'devops-agent', description: 'Autonomous DevOps agent for infrastructure monitoring and incident response',
model: { provider: 'openai', name: 'gpt-4o', temperature: 0.3, // Low temperature for reliable ops decisions },
deploy: { platform: 'kernova-cloud', region: 'us-east', },});Step 3: Push to GitHub
If you havenβt already, initialize git and push:
git initgit add .git commit -m "feat: autonomous devops agent with workflows and triggers"git remote add origin https://github.com/YOUR_USERNAME/devops-agent.gitgit push -u origin mainStep 4: Connect to Kernova Cloud
Option A: Deploy from the CLI
# Login to Kernova Cloudkernova login
# Deploykernova deployThe CLI:
- Pushes your code to the connected GitHub repo
- Sends a deploy request to Kernova Cloud
- Kernova Cloud creates a Render service
- Render builds and starts your app
- Your agent is live
Option B: Deploy from the Dashboard
- Go to kernova-cloud.vercel.app
- Click βImport Projectβ
- Select your
devops-agentGitHub repo - Kernova Cloud auto-detects the framework and deploys
Step 5: Add Environment Variables
In the Kernova Cloud dashboard:
- Open your project β Environment tab
- Add each variable:
| Key | Value | Description |
|---|---|---|
OPENAI_API_KEY | sk-... | AI provider key |
SLACK_BOT_TOKEN | xoxb-... | Slack bot token |
SLACK_SIGNING_SECRET | ... | Slack app signing secret |
RENDER_API_KEY | rnd_... | Render API key (for restarts) |
- Click βSave & Redeployβ
Step 6: Set Up Webhook URLs
Once deployed, your app will be live at something like:
https://kn-devops-agent.onrender.comNow configure your monitoring tools to send alerts to:
POST https://kn-devops-agent.onrender.com/hooks/alertsAnd GitHub webhooks to:
POST https://kn-devops-agent.onrender.com/hooks/githubUptimeRobot Example
- Go to UptimeRobot β Alert Contacts β Add Contact
- Type: Webhook
- URL:
https://kn-devops-agent.onrender.com/hooks/alerts - POST body:
{"source": "uptimerobot","severity": "critical","service": "*monitorFriendlyName*","message": "*alertDetails*"}
GitHub Webhook Setup
- Go to your repo β Settings β Webhooks β Add webhook
- Payload URL:
https://kn-devops-agent.onrender.com/hooks/github - Content type:
application/json - Select events: Push, Releases, Deployment status
Step 7: Set Up a Custom Domain (Optional)
In the Kernova Cloud dashboard:
- Open your project β Domains tab
- Add:
devops.yourdomain.com - Add the CNAME record to your DNS:
devops.yourdomain.com β kn-devops-agent.onrender.com
Step 8: Monitor in Production
Check Agent Status
In the dashboard, go to Agents tab:
βββββββββββββββββββββββββββββββββββββββββββββββ π€ devops ββ ββ Status: β Online ββ Model: gpt-4o ββ Uptime: 3 days, 14 hours ββ Actions today: 47 ββ ββ Active Workflows: ββ incident-response β Step 4 (awaiting) ββ daily-audit β Completed 2h ago ββ ββ Recent Triggers: ββ on-critical-alert β fired 15 min ago ββ scheduled-health-check β fired 2 min ago βββββββββββββββββββββββββββββββββββββββββββββββCheck Workflow History
In the Workflows tab:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Workflow Runs ββ ββ incident-response 10:30 AM β Completed (5/5 steps) ββ incident-response 09:15 AM β Denied at step 4 ββ daily-audit 06:00 AM β Completed (2/2 steps) ββ incident-response Yesterday β Completed (5/5 steps) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββView Logs
In the Logs tab, youβll see real-time output:
10:30:02 [Channel: alerts] Received alert from uptime-monitor10:30:02 [Trigger: on-critical-alert] Firing for api-gateway10:30:03 [Workflow: incident-response] Starting step: detect10:30:04 [Tool: check-health] api-gateway β unhealthy (503)10:30:04 [Workflow] Step "detect" completed. Checkpointed.10:30:05 [Workflow: incident-response] Starting step: diagnose10:30:06 [Tool: get-metrics] Memory: 94%, Uptime: 7 days10:30:06 [Workflow] Step "diagnose" completed. Checkpointed.10:30:07 [Workflow: incident-response] Starting step: notify10:30:07 [Slack] Sent to #incidents10:30:07 [Workflow] Step "fix" β AWAITING APPROVALComplete Project Structure (Final)
devops-agent/βββ agents/β βββ devops.ts # Main agent definitionβ βββ tools/β β βββ check-health.ts # Health check toolβ β βββ get-metrics.ts # Metrics toolβ β βββ restart-service.ts # Restart tool (requires approval)β βββ channels/β β βββ alerts.ts # Webhook for monitoring alertsβ β βββ github.ts # GitHub webhook eventsβ β βββ slack.ts # Slack two-way communicationβ βββ triggers/β β βββ on-alert.ts # Auto-investigate critical alertsβ β βββ on-deploy.ts # Post-deploy health checksβ β βββ scheduled-check.ts # Every 5 minutes health scanβ βββ workflows/β βββ incident-response.ts # Full incident pipeline (5 steps)β βββ daily-audit.ts # Scheduled daily reportβββ app/β βββ page.tsx # Dashboard UIβ βββ layout.tsx # Next.js layoutβββ .env.local # Local environment variablesβββ kernova.config.ts # Framework configurationβββ package.jsonβββ tsconfig.jsonWhat You Built
Letβs recap the entire system:
| Layer | What You Built | How It Works |
|---|---|---|
| Agent | DevOps personality with system prompt | Understands infrastructure, thinks like an SRE |
| Tools | health check, metrics, restart | Agent calls these to interact with infra |
| Channels | Webhooks (alerts, GitHub), Slack | External systems send events INTO the agent |
| Triggers | Critical alerts, post-deploy, schedule | Rules that auto-wake the agent |
| Workflows | Incident response, daily audit | Multi-step durable pipelines with approval |
| Approval | Human-in-the-loop on restart | Dangerous actions require human sign-off |
| Deploy | Kernova Cloud + Render | Runs 24/7 in production |
Whatβs Different from a Basic Chatbot
| Feature | Basic Chatbot | Your DevOps Agent |
|---|---|---|
| Input | Only responds to chat | Reacts to webhooks, schedules, events |
| Safety | No guardrails | Approval gates on dangerous actions |
| Reliability | Loses state on crash | Durable execution with checkpointing |
| Multi-step | Single turn | Workflows with multiple steps |
| Integration | None | Slack, GitHub, monitoring tools |
| Deployment | Manual | One-command deploy with CI/CD |
Next Steps
Now that youβve mastered the advanced features, here are ideas to extend your agent:
- Add more tools: Scale up/down instances, roll back deployments, manage DNS
- Add more channels: PagerDuty, Discord, Telegram, email
- Add more workflows: Deployment pipeline, security scan, cost optimization
- Add memory: Track incident history, learn from past issues
- Multi-agent: Create a βsecurityβ agent and a βperformanceβ agent that collaborate
Congratulations! π
Youβve built a production-grade autonomous DevOps agent using the full power of the Kernova framework:
defineAgentβ the braindefineToolβ the handsdefineChannelβ the earsdefineTriggerβ the reflexesdefineWorkflowβ the long-term memory and planningrequiresApprovalβ the safety net
This is what separates a toy chatbot from a real AI agent that runs in production. Ship it.
Full Tutorial Navigation
- Introduction
- Project Setup
- Define the Agent
- Build the Tools
- Triggers & Channels
- Durable Workflows
- Deploy to Production (you are here)