# 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/` - Commit with message: `feat: deploy ` - 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.