Skip to content

Overall Architecture

This page describes the overall architecture design of OpsAnt.

Architecture Diagram

graph TB
    subgraph 前端
        UI[Vue 3 + Ant Design Vue<br/>SPA]
    end

    subgraph 后端
        API[Django API<br/>api/opsant/v1/]
        CELERY[Celery Worker]
        BEAT[Celery Beat<br/>定时任务]
    end

    subgraph 执行引擎
        ANS[Ansible<br/>SSH 主机]
        SALT[SaltStack<br/>Agent 主机]
        MINI[OpsMini Server<br/>Go / gRPC]
    end

    subgraph 数据
        DB[(MySQL)]
        REDIS[(Redis)]
    end

    subgraph 监控
        PROM[Prometheus]
        AM[Alertmanager]
        CONSUL[Consul]
    end

    UI --> API
    API --> DB
    API --> REDIS
    CELERY --> ANS
    CELERY --> SALT
    CELERY --> MINI
    BEAT --> CELERY
    API --> PROM
    API --> AM
    API --> CONSUL
    MINI --> REDIS
    MINI --> CONSUL

Core Design

Frontend-Backend Separation

  • Frontend: Vue 3 + Ant Design Vue, SPA, build artifacts output to static/opsant/
  • Backend: Django, provides REST API with api/opsant/v1/ prefix, response envelope {code, message, data}

Three Execution Engines

Routing to different execution engines based on host management method:

Management Method Execution Engine Description
SSH Ansible Agentless, SSH-based
Agent SaltStack salt-minion push model
OpsMini OpsMini Server Go implementation, gRPC data plane

Dual-Mode Switch

The platform supports switching via OPSANT_ENABLED:

  • true: Standalone product form (includes frontend and new API)
  • false: Pure OpsAny Proxy legacy routing

The two routing modes are isolated and do not affect each other.

De-SaltStack-ified OpsMini Agent

OpsMini is an independent Go Agent project that adopts a pull model where the Agent (panel) exposes REST API and the Proxy actively pulls from it, similar in approach to Prometheus, rather than the salt-minion push model.

More Detailed Information