Skip to content

A robust and declarative APISIX configuration sync tool for routes, upstreams, and services – powered by Bash + jq.

License

Notifications You must be signed in to change notification settings

cncap/apisix-syncer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 apisix-syncer

A full-featured APISIX resource sync tool powered by Bash + jq.
Declarative. Lightweight. Git-friendly. Built for developers.


🚀 Features

  • ✅ Sync routes, upstreams, and services in one pass
  • ✅ Supports --dry-run, --check, --list, --prune
  • ✅ Accurate diff preview using jq-based JSON comparison
  • ✅ Clean CLI output for CI/CD and GitOps-friendly workflows
  • ✅ Zero dependencies beyond bash, curl, and jq

🗂️ Directory Layout

apisix-sync/
├── sync.sh
├── env/
│   └── dev.env
├── routes/
│   └── dev.json
├── services/
│   └── dev.json
├── upstreams/
│   └── shared.json

🔧 Usage

./sync.sh --env dev --dry-run          # Show changes without applying
./sync.sh --env dev --sync             # Apply changes to APISIX
./sync.sh --env dev --sync --prune     # Sync and delete undeclared remote resources
./sync.sh --env dev --check            # Check whether declared resources exist
./sync.sh --env dev --list             # List remote routes, services, and upstreams

Each resource file is a pure JSON array. Only the id field is required per object.


🌐 Sample .env file

# env/dev.env
ADMIN="http://localhost:8000/apisix/admin"
ADMIN_KEY="your-admin-api-key"

💡 Sample route config

[
  {
    "id": "auth-login",
    "uri": "/auth/login",
    "service_id": "zenglow-auth-service"
  }
]

📦 Requirements

  • bash ≥ 4.x
  • curl
  • jq ≥ 1.6

🧙 Authors

  • Vemax — Builder of gateways and configuration master
  • Copilot — Your loyal scripting sidekick 🤖✨

About

A robust and declarative APISIX configuration sync tool for routes, upstreams, and services – powered by Bash + jq.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages