Skip to content

Set up ArgoCD applications for GitOps #238

@Hyperkit-dev

Description

@Hyperkit-dev

🎯 Layer 1: Intent Parsing

What needs to be done?

Task Title:

Set up ArgoCD applications for GitOps

Area: infra | Repos: infra/

Primary Goal:

Configure ArgoCD applications to enable GitOps-based continuous deployment for HyperAgent services, ensuring infrastructure and application changes are managed through version-controlled manifests

User Story / Context:

As a DevOps engineer, I want ArgoCD applications configured for GitOps so that deployments are automated, auditable, and follow infrastructure-as-code best practices

Business Impact:

Enables automated, reliable deployments with full audit trail. Supports Phase 1 Foundation goals for CI/CD and infrastructure automation. Critical for production readiness.

Task Metadata:


📚 Layer 2: Knowledge Retrieval

What information do I need?

Required Skills / Knowledge:

  • DevOps/Infra (CI/CD, Docker, Kubernetes)
  • ArgoCD and GitOps principles
  • Kubernetes manifests (Helm/Kustomize)

Estimated Effort:

M (Medium - 3-5 days)

Knowledge Resources:

  • Review .cursor/skills/ for relevant patterns (gitops-workflow, gitops-principles-skill, devops-engineer)
  • Check .cursor/llm/docs/ for implementation examples
  • Read Platform Blueprint: docs/draft.md
  • Read System Architecture: docs/planning/4-System-Architecture-Design.md
  • Read Execution Strategy: docs/reference/spec/execute.md
  • Study tech docs / ADRs in docs/adrs/ directory
  • Review ArgoCD documentation and best practices

Architecture Context:

According to the Platform Blueprint, HyperAgent uses a microservice architecture. ArgoCD will manage deployments for orchestrator, agent services, and core services across Kubernetes clusters.

System Architecture Diagram:

graph TB
    subgraph "Git Repository"
        Manifests[K8s Manifests<br/>Helm/Kustomize]
        Config[ConfigMaps<br/>Secrets]
    end
    
    subgraph "ArgoCD"
        App1[Orchestrator App]
        App2[Agent Services App]
        App3[Core Services App]
        Sync[Sync Policies]
    end
    
    subgraph "Kubernetes Cluster"
        Namespace1[Orchestrator Namespace]
        Namespace2[Agents Namespace]
        Namespace3[Services Namespace]
    end
    
    Manifests --> App1
    Manifests --> App2
    Manifests --> App3
    Config --> App1
    Config --> App2
    Config --> App3
    
    App1 --> Sync
    App2 --> Sync
    App3 --> Sync
    
    Sync --> Namespace1
    Sync --> Namespace2
    Sync --> Namespace3
Loading

Code Examples & Patterns:

ArgoCD Application Example:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: hyperagent-orchestrator
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/Hyperkit-labs/hyperagent
    targetRevision: main
    path: infra/k8s/orchestrator
  destination:
    server: https://kubernetes.default.svc
    namespace: hyperagent-orchestrator
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true

⚠️ Layer 3: Constraint Analysis

What constraints and dependencies exist?

Known Dependencies:

  • Kubernetes cluster must be provisioned and accessible
  • ArgoCD must be installed in the cluster
  • Git repository with Kubernetes manifests must be ready
  • Container images must be built and pushed to registry

Technical Constraints:

Scope limited to ArgoCD application configuration. Kubernetes cluster setup and ArgoCD installation tracked separately.

Current Blockers:

None identified (update as work progresses)

Risk Assessment & Mitigations:

Risk of misconfigured sync policies causing unintended deployments. Mitigation: Use automated sync with self-heal disabled initially, implement proper RBAC, test in staging environment first.

Resource Constraints:

  • Deadline: Feb 5–17 (Sprint 1)
  • Effort Estimate: M (Medium - 3-5 days)

💡 Layer 4: Solution Generation

How should this be implemented?

Solution Approach:

Create ArgoCD Application manifests for each major service:

  1. Orchestrator service application
  2. Agent services application (SpecAgent, CodeGenAgent, AuditAgent, etc.)
  3. Core services application (Project service, data layer)
  4. Frontend application (if applicable)

Configure sync policies (automated vs manual), health checks, and namespace management.
Use Helm or Kustomize for environment-specific overlays (dev, staging, prod).

Design Considerations:

  • Follow established patterns from .cursor/skills/gitops-workflow
  • Maintain consistency with existing infrastructure code
  • Consider scalability and maintainability
  • Ensure proper error handling and rollback capabilities
  • Plan for testing and validation
  • Implement proper RBAC and security policies
  • Support multi-environment deployments (dev, staging, prod)

Acceptance Criteria (Solution Validation):

  • ArgoCD applications created for all major services
  • Sync policies configured appropriately
  • Health checks and status monitoring working
  • Multi-environment support (dev/staging/prod overlays)
  • RBAC policies implemented
  • Documentation updated with ArgoCD setup and usage
  • Integration tests passing
  • Code reviewed and approved

📋 Layer 5: Execution Planning

What are the concrete steps?

Implementation Steps:

  1. Review Kubernetes cluster and ArgoCD installation status
  2. Design ArgoCD application structure and sync policies
  3. Create Kubernetes manifests directory structure
  4. Create ArgoCD Application manifest for orchestrator service
  5. Create ArgoCD Application manifest for agent services
  6. Create ArgoCD Application manifest for core services
  7. Configure environment overlays (dev, staging, prod)
  8. Set up RBAC policies for ArgoCD
  9. Test ArgoCD sync in development environment
  10. Document ArgoCD setup and usage procedures
  11. Code review and approval
  12. Deploy to staging and verify

Environment Setup:
Repos / Services:

  • Infra / IaC repo: hyperagent/infra/
  • Kubernetes cluster with ArgoCD installed

Required Environment Variables:

  • KUBECONFIG= (Kubernetes cluster configuration)
  • ARGOCD_SERVER_URL= (ArgoCD server URL)
  • ARGOCD_AUTH_TOKEN= (ArgoCD authentication token)
  • DOCKER_REGISTRY_URL= (Container registry URL)

Access & Credentials:

  • Kubernetes cluster access: kubeconfig file
  • ArgoCD admin credentials: Internal vault
  • Access request: Contact @devops or project lead

✅ Layer 6: Output Formatting & Validation

How do we ensure quality delivery?

Ownership & Collaboration:

Quality Gates:

  • Code follows project style guide (see .cursor/rules/rules.mdc)
  • All tests pass (unit, integration, e2e)
  • No critical lint/security issues
  • Documentation updated (README, code comments, ADRs if needed)
  • Meets all acceptance criteria from Layer 4
  • Follows production standards (see .cursor/rules/production.mdc)

Review Checklist:

  • Code review approved by @ArhonJay
  • CI/CD pipeline passes (GitHub Actions)
  • ArgoCD applications sync successfully
  • Security scan passes (no critical vulnerabilities)
  • Multi-environment deployments verified
  • Documentation complete and accurate

Delivery Status:

  • Initial Status: To Do
  • Progress Tracking: Use issue comments for updates
  • Sign-off: Approved by @Hyperionkit on [YYYY-MM-DD]
  • PR Link: [Link to merged PR(s)]

Related Issues:

  • Related to CI/CD and infrastructure setup

Documentation References:

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions