Skip to content

abhicodes11/Edgectl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edgectl - Edge Control CLI

A CLI tool for managing edge computing nodes and workloads, similar to keadm. Built with Go and the Cobra framework.

Features

  • Node Management: List, describe, label, and check status of edge nodes
  • Workload Management: Deploy, delete, list workloads and view logs
  • Batch Operations: Enable/disable nodes with concurrency and timeout control
  • Multiple Output Formats: Table, JSON, YAML
  • Configuration: Config file support with ~/.edgectl/config.yaml

Installation

From Source

# Clone and build
git clone <repo>
cd edgectl
make build

# Or install to GOPATH/bin
make install

Quick Build

go build -o edgectl .

Usage

Node Commands

# List all nodes in table format
edgectl node list

# List nodes with JSON output
edgectl node list --output json

# List nodes matching selector
edgectl node list --selector region=us-west

# Describe specific node
edgectl node describe edge-node-1

# Add label to node
edgectl node label edge-node-1 environment=production

# Check node status
edgectl node status edge-node-1

Workload Commands

# List workloads
edgectl workload list

# Deploy workload to multiple nodes
edgectl workload deploy --image nginx:latest --nodes edge-node-1,edge-node-2,edge-node-3

# Deploy with replicas
edgectl workload deploy --image redis:alpine --nodes edge-node-1,edge-node-2 --replicas 3

# Delete workload (requires --force)
edgectl workload delete --name nginx-prod --force

# View workload logs
edgectl workload logs nginx-prod

# Stream logs
edgectl workload logs redis-cache --follow

Batch Commands

# Batch enable with concurrency
edgectl batch enable --nodes edge-node-1,edge-node-2,edge-node-3 --concurrency 2

# Batch enable using selector
edgectl batch enable --selector region=us-west

# Batch disable using selector
edgectl batch disable --selector region=factory-west --timeout 30s

# Check batch status
edgectl batch status --nodes edge-node-1,edge-node-2,edge-node-3 --output json

Configuration

# View config
edgectl config view

# Set output format
edgectl config set default-output json

# Set concurrency
edgectl config set concurrency 5

# Set timeout
edgectl config set timeout 60s

Global Flags

--config string    Config file (default: $HOME/.edgectl/config.yaml)
--kubeconfig       Path to kubeconfig
-v, --verbose      Verbose output
-o, --output       Output format (table|json|yaml)

Configuration File

Create ~/.edgectl/config.yaml:

default-output: table
concurrency: 5
timeout: 60s
nodes:
  - edge-node-1
  - edge-node-2
selectors:
  region: us-west

Development

# Download dependencies (run first if go.sum is missing)
go mod tidy

# Run tests
make test

# Run with coverage
make coverage

# Format code
make fmt

# Lint
make lint

Troubleshooting

If you encounter TLS/certificate errors when running go mod tidy or go build, try:

  • Ensure your system certificates are up to date
  • Use GOPROXY=https://proxy.golang.org,direct (default)
  • Check your network/firewall allows HTTPS to proxy.golang.org

Project Structure

edgectl/
├── cmd/           # Cobra commands
├── pkg/           # Shared packages (output, batch, config, node)
├── internal/      # Mock data for demo
├── main.go
└── Makefile

License

Owned by abhicodes11.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published