feat: Implement Phase 1 K8s agent orchestrator system
Core agent system for Raspberry Pi k0s cluster management: Agents: - k8s-orchestrator: Central task delegation and decision making - k8s-diagnostician: Cluster health, logs, troubleshooting - argocd-operator: GitOps deployments and rollbacks - prometheus-analyst: Metrics queries and alert analysis - git-operator: Manifest management and PR workflows Workflows: - cluster-health-check.yaml: Scheduled health assessment - deploy-app.md: Application deployment guide - pod-crashloop.yaml: Automated incident response Skills: - /cluster-status: Quick health overview - /deploy: Deploy or update applications - /diagnose: Investigate cluster issues Configuration: - Agent definitions with model assignments (Opus/Sonnet) - Autonomy rules (safe/confirm/forbidden actions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
97
workflows/deploy/deploy-app.md
Normal file
97
workflows/deploy/deploy-app.md
Normal file
@@ -0,0 +1,97 @@
|
||||
# Deploy Application Workflow
|
||||
|
||||
A simple workflow for deploying new applications or updating existing ones.
|
||||
|
||||
## When to use
|
||||
|
||||
Use this workflow when:
|
||||
- Deploying a new application to the cluster
|
||||
- Updating an existing application's configuration
|
||||
- Rolling out a new version of an application
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Gather Requirements
|
||||
|
||||
Ask the user for:
|
||||
- Application name
|
||||
- Container image and tag
|
||||
- Namespace (default: `default`)
|
||||
- Resource requirements (CPU/memory limits)
|
||||
- Exposed ports
|
||||
- Any special requirements (tolerations for Pi 3, etc.)
|
||||
|
||||
### 2. Check Existing State
|
||||
|
||||
Delegate to **argocd-operator** (haiku):
|
||||
- Check if application already exists in ArgoCD
|
||||
- If exists, get current status and version
|
||||
|
||||
Delegate to **k8s-diagnostician** (haiku):
|
||||
- If exists, check current pod status
|
||||
- Check namespace exists
|
||||
|
||||
### 3. Create/Update Manifests
|
||||
|
||||
Delegate to **git-operator** (sonnet):
|
||||
- Create or update deployment manifest
|
||||
- Create or update service manifest (if ports exposed)
|
||||
- Create or update kustomization.yaml
|
||||
- Include appropriate resource limits for Pi cluster:
|
||||
```yaml
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
```
|
||||
- If targeting Pi 3, add tolerations:
|
||||
```yaml
|
||||
tolerations:
|
||||
- key: "node-type"
|
||||
operator: "Equal"
|
||||
value: "pi3"
|
||||
effect: "NoSchedule"
|
||||
```
|
||||
|
||||
### 4. Commit Changes
|
||||
|
||||
Delegate to **git-operator** (sonnet):
|
||||
- Create feature branch: `deploy/<app-name>`
|
||||
- Commit with message: `feat: deploy <app-name>`
|
||||
- Push branch to origin
|
||||
- Create pull request
|
||||
|
||||
**[CONFIRM]** User must approve the PR creation.
|
||||
|
||||
### 5. Sync Application
|
||||
|
||||
After PR is merged:
|
||||
|
||||
Delegate to **argocd-operator** (sonnet):
|
||||
- Create ArgoCD application if new
|
||||
- Trigger sync for the application
|
||||
- Wait for sync to complete
|
||||
|
||||
**[CONFIRM]** User must approve the sync operation.
|
||||
|
||||
### 6. Verify Deployment
|
||||
|
||||
Delegate to **k8s-diagnostician** (haiku):
|
||||
- Check pods are running
|
||||
- Check no restart loops
|
||||
- Verify resource usage is within limits
|
||||
|
||||
Report final status to user.
|
||||
|
||||
## Rollback
|
||||
|
||||
If deployment fails:
|
||||
|
||||
Delegate to **argocd-operator**:
|
||||
- Check application history
|
||||
- Propose rollback to previous version
|
||||
|
||||
**[CONFIRM]** User must approve rollback.
|
||||
Reference in New Issue
Block a user