zega-cc-agent
v1.0.0
Published
SRE Control Center Agent - connects to backend and provides AWS/K8s/SSH capabilities
Maintainers
Readme
SRE Control Center Agent
A daemon agent that connects to the SRE Control Center backend and provides:
- AWS EC2 instance management
- AWS Lambda function management
- Kubernetes workload management
- SSH/SSM terminal access
- LDAP authentication
Installation
npm install -g zega-cc-agentConfiguration
Set the following environment variables:
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| BACKEND_URL | No | http://localhost:4000 | Backend server URL |
| AGENT_API_KEY | Yes | - | API key from Settings > Agents |
| CACHE_REFRESH_INTERVAL | No | 180000 | Data refresh interval (ms) |
Usage
Direct execution
export BACKEND_URL=https://sre.example.com
export AGENT_API_KEY=your-api-key-here
zega-cc-agentAs a systemd service
Create /etc/systemd/system/zega-cc-agent.service:
[Unit]
Description=SRE Control Center Agent
After=network.target
[Service]
Type=simple
User=sre-agent
Environment=BACKEND_URL=https://sre.example.com
Environment=AGENT_API_KEY=your-api-key
ExecStart=/usr/bin/zega-cc-agent
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetThen:
sudo systemctl daemon-reload
sudo systemctl enable zega-cc-agent
sudo systemctl start zega-cc-agentWith PM2
npm install -g pm2
BACKEND_URL=https://sre.example.com \
AGENT_API_KEY=your-api-key \
pm2 start zega-cc-agent --name sre-agent
pm2 save
pm2 startupWith Docker
FROM node:20-alpine
RUN npm install -g zega-cc-agent
ENV BACKEND_URL=https://sre.example.com
# AGENT_API_KEY must be provided at runtime
CMD ["zega-cc-agent"]Run:
docker run -d \
--name sre-agent \
--restart unless-stopped \
-e BACKEND_URL=https://sre.example.com \
-e AGENT_API_KEY=your-api-key \
zega-cc-agentRequirements
- Node.js >= 18.0.0
- AWS credentials configured (for EC2/Lambda)
- Kubernetes config (for K8s features)
- SSH keys in
~/keys/directory (for SSH access)
Getting an API Key
- Log in to the SRE Control Center
- Go to Settings > Agents
- Click "New Agent"
- Copy the generated API key
License
MIT
