Skip to content

ao/hivemind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hivemind

A lightweight, distributed container orchestration platform built in Rust

πŸš€ What is Hivemind?

Hivemind is a modern, lightweight container orchestration system designed with simplicity and performance in mind. Think of it as a Kubernetes alternative that's easier to set up, understand, and operate - perfect for smaller deployments, edge computing, or when you need a container platform without the complexity.

✨ Key Features

  • πŸ”„ Simple yet powerful - Deploy containers with a clean REST API or straightforward CLI
  • ⚑ Blazing fast - Built in Rust for minimal resource usage and maximum performance
  • πŸ“¦ Containerd integration - Works directly with containerd for reliable container operations
  • πŸ” Service Discovery - Automatic DNS-based service discovery for your applications
  • 🌐 Clustering - Seamlessly scale from a single node to a distributed cluster
  • πŸ”’ Volume Management - Persistent storage for your stateful applications
  • πŸ–₯️ Clean Web UI - Monitor and manage everything through an intuitive dashboard
  • πŸ”Œ Container Networking - Seamless communication between containers across nodes
  • πŸ” Security Features - Container scanning, network policies, RBAC, and secret management
  • 🩺 Health Monitoring - Comprehensive health checking and auto-healing capabilities
  • πŸ“Š Network-Aware Scheduling - Intelligent container placement based on network topology
  • πŸ”„ Node Membership Protocol - SWIM-based cluster membership management
  • πŸš€ Advanced Deployment Strategies - Blue-green, canary, and A/B testing deployments
  • ☁️ Cloud Provider Integration - Seamless integration with AWS, Azure, and GCP
  • πŸ“ˆ Observability - Prometheus metrics, OpenTelemetry tracing, and log aggregation
  • πŸ”„ CI/CD Integration - Built-in support for CI/CD pipelines and GitHub Actions
  • βš“ Helm Chart Support - Deploy applications using Helm charts

πŸ”§ Quick Start

Install Hivemind

cargo install hivemind

Start the daemon

hivemind daemon --web-port 3000

Deploy your first application

hivemind app deploy --image nginx:latest --name my-web-app --service web.local

Visit http://localhost:3000 to see your application in the Hivemind dashboard!

πŸ“‹ Command Reference

Hivemind offers a comprehensive CLI for all operations:

Global Options

hivemind --data-dir <PATH>  # Set the data directory (default: ~/.hivemind)

Daemon Mode

# Start the Hivemind daemon
hivemind daemon --web-port <PORT>  # Start the server (default port: 3000)

# Start only the web interface (useful for development)
hivemind web --port <PORT>  # Start only the web UI (default port: 3000)

Cluster Management

# Join an existing Hivemind cluster
hivemind join --host <HOST_ADDRESS>  # Connect to an existing cluster

# List all nodes in the cluster
hivemind node ls

# Show detailed node information
hivemind node info

Application Management

# List all applications
hivemind app ls

# Deploy a new application
hivemind app deploy --image <IMAGE> --name <NAME> [--service <DOMAIN>]

# Scale an application to a specific number of replicas
hivemind app scale --name <NAME> --replicas <COUNT>

# List all containers
hivemind app containers

# Show detailed container information
hivemind app container-info --container-id <CONTAINER_ID>

# Restart an application
hivemind app restart --name <NAME>

System Health

# Check system health
hivemind health  # Shows health status of nodes, containers, and services

Volume Management

# Create a new volume
hivemind volume create --name <VOLUME_NAME>

# List all volumes
hivemind volume ls

# Delete a volume
hivemind volume delete --name <VOLUME_NAME>

# Deploy with volume mounts
hivemind app deploy --image <IMAGE> --name <NAME> --volume <VOLUME_NAME>:<CONTAINER_PATH>

Security Management

# Scan a container image for vulnerabilities
hivemind security scan-image --image <IMAGE>

# List security policies
hivemind security list-policies

# Create a new secret
hivemind security create-secret --name <NAME> --file <FILE_PATH>

# Mount a secret to a container
hivemind app deploy --image <IMAGE> --name <NAME> --secret <SECRET_NAME>:<CONTAINER_PATH>

πŸ”Œ API Reference

Hivemind offers a RESTful API for all operations:

Endpoint Method Description
/api/nodes GET List all nodes
/api/containers GET List all containers
/api/images GET List available images
/api/services GET List all services
/api/service-endpoints GET List all service endpoints
/api/health GET Get system health metrics
/api/deploy POST Deploy a new container
/api/scale POST Scale an application
/api/restart POST Restart an application
/api/service-url POST Get URL for a service
/api/volumes GET List all volumes
/api/volumes/create POST Create a new volume
/api/volumes/delete POST Delete a volume
/api/security/scan POST Scan a container image
/api/security/policies GET List security policies
/api/security/secrets GET List secrets (metadata only)
/api/security/secrets/create POST Create a new secret

🌟 Why Hivemind?

For Users

  • Simple to learn - No steep learning curve or complex YAML files
  • Resource-efficient - Runs well even on lower-powered hardware
  • Predictable - Designed to be stable and behave consistently
  • Self-contained - Minimal dependencies means fewer things to break
  • Secure by default - Built-in security features protect your workloads

For Developers

  • Clean codebase - Well-structured Rust code that's a joy to work with
  • Modular architecture - Easy to extend with new features
  • API-first design - Build tools and integrations with our comprehensive API
  • Fast compile-test cycle - Quick iteration for development
  • Comprehensive security - Security features built into the core platform

πŸ“Š Comparison with other platforms

Feature Hivemind Kubernetes Docker Swarm
Startup time ⚑ Seconds ⏱️ Minutes ⏱️ Minutes
Memory usage πŸƒ ~50MB πŸ‹οΈ ~500MB+ πŸ‹οΈ ~200MB+
Learning curve πŸ“˜ Low πŸ“š High πŸ“— Medium
Scaling βœ… Yes βœ… Yes βœ… Yes
Auto-healing βœ… Yes βœ… Yes βœ… Yes
Cloud native βœ… Yes βœ… Yes ⚠️ Partial
Security features βœ… Comprehensive βœ… Extensive ⚠️ Basic
Network-aware scheduling βœ… Yes βœ… Yes ❌ No

🧩 Architecture

Hivemind follows a clean, modular architecture:

  • App Manager - Application and container lifecycle management
  • Node Manager - Cluster coordination and node discovery
  • Node Membership Protocol - SWIM-based cluster membership management
  • Service Discovery - DNS-based service discovery and routing
  • Storage Manager - Volume and persistence handling
  • Container Manager - Container runtime integration
  • Network Manager - Container networking and overlay network
  • Scheduler - Network-aware container placement
  • Health Monitor - Container and node health monitoring
  • Security Manager - Security features including scanning, RBAC, and secrets
  • Web UI - Dashboard and visual management
  • Deployment Manager - Advanced deployment strategies (blue-green, canary, A/B testing)
  • Cloud Manager - Integration with cloud providers (AWS, Azure, GCP)
  • Observability Manager - Metrics, tracing, and logging
  • CI/CD Manager - CI/CD pipeline integration
  • Helm Manager - Helm chart support

For more details, see ARCHITECTURE.md.

πŸ“¦ Features in Detail

Container Management

Hivemind provides comprehensive container lifecycle management:

  • Deploy containers from various image sources
  • Scale applications up or down with automatic load balancing
  • Restart containers with zero downtime
  • Monitor container metrics including CPU, memory, and network usage
  • View container logs directly from the dashboard

Service Discovery

Enhanced DNS-based service discovery allows:

  • Service domains for easy access to your applications
  • Automatic load balancing across container instances with multiple strategies
  • Advanced health checking with configurable protocols and parameters
  • Built-in DNS server for resolving service domains
  • Network integration for seamless cross-node communication
  • Circuit breaking to prevent routing traffic to unhealthy endpoints

Volume Management

Persistent storage for stateful applications:

  • Create and manage volumes for persistent data
  • Mount volumes to containers during deployment
  • Back up volume data for disaster recovery
  • Monitor volume usage to prevent storage issues

Clustering

Distributed operation for scaling and high availability:

  • Auto-discovery of nodes on the network
  • Seamless joining of new nodes to the cluster
  • Resource-aware scheduling of containers
  • Node health monitoring for reliability
  • Distributed storage for cluster state

Container Networking

Seamless communication between containers across nodes:

  • Automatic IP allocation - Each container gets a unique IP address
  • Overlay networking - VXLAN-based overlay for cross-node communication
  • Network policies - Control traffic flow between containers
  • Service discovery integration - Find services by name rather than IP
  • Network health monitoring - Track network status and connectivity
  • Network-aware scheduling - Optimize container placement based on network topology
  • Service affinity/anti-affinity - Place related services together or apart based on rules
  • Dynamic rebalancing - Move containers to optimize network performance

Health Monitoring

Comprehensive health monitoring and auto-healing:

  • Container health checks - Monitor container health with customizable checks
  • Node health monitoring - Track node health and resource usage
  • Automatic container restart - Restart unhealthy containers
  • Failure detection - Detect and respond to node failures
  • Health metrics - Track health metrics over time
  • Alerting - Generate alerts for health issues

Security Features

Comprehensive security features to protect your workloads:

  • Container scanning - Scan container images for vulnerabilities
  • Network policies - Control traffic flow between containers
  • Role-Based Access Control (RBAC) - Control access to resources
  • Secret management - Securely store and distribute sensitive information
  • Audit logging - Track all security-related events
  • Encryption - Encrypt sensitive data and network traffic

πŸ› οΈ Development

Prerequisites

  • Rust 1.60 or newer
  • containerd (for non-mock deployments)
  • SQLite

Building from source

# Clone the repository
git clone https://github.com/ao/hivemind.git
cd hivemind

# Build the project
cargo build --release

Development Mode

For faster development cycles, you can run with mock implementations:

cargo run -- web --port 3000

Run tests

cargo test

For more details, see developer_guide.md.

πŸ“š Documentation

πŸ“œ License

Hivemind is licensed under the MIT License - see the LICENSE file for details.

About

A lightweight, distributed container orchestration platform built in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published