8000 GitHub - simplecontainer/smr: Simplecontainer manager a.k.a smr. Standalone and cluster mode, GitOps, Secrets, Reconciliation, and YAML definitions for Docker.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

simplecontainer/smr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simplecontainer

Simplecontainer GitOps

Important

This project is currently in alpha stage. Use with caution in production environments.

Overview

Simplecontainer is a container orchestration platform that transforms Docker daemons into managed nodes with GitOps capabilities. It provides enterprise-grade features like overlay networking, secrets management, and multi-node clustering while maintaining the simplicity of Docker.

Key Features

  • GitOps Deployment: Deploy containers using Git repositories as the source of truth
  • Overlay Networking: Secure container communication using Flannel with WireGuard encryption
  • Multi-Node Clustering: Scale across multiple Docker daemons with RAFT consensus
  • Dependency Management: Reliable container startup ordering with readiness probes
  • Secrets & Configuration: Built-in secret and configuration management
  • mTLS Security: Encrypted control plane communication
  • Real-time Dashboard: Web UI for monitoring and management

Quick Start

Prerequisites

`- Docker installed and running (Installation Guide)

Installation

  1. Download and install tooling(smrmgr.sh, smr, and smrctl):
curl -sL https://raw.githubusercontent.com/simplecontainer/smr/refs/heads/main/scripts/production/smrmgr.sh -o smrmgr
chmod +x smrmgr
sudo mv smrmgr /usr/local/bin
sudo smrmgr install
  1. Start a single node with default configuration:
sudo smrmgr start
  1. Configure the CLI client:
smrctl context import $(smr agent export --api $(smr node ip):1443) -y
smrctl ps

Running dashboard

After starting node, dashboard can be started on the local machine.

Important

Dashboard doesn't implement any authentication. The path ~/.smrctl will be mounted in the dashboard container. All contexts that are available to the user will be available to the dasboard.

smrctl context import $(smr agent export --api $(smr node ip):1443) -y
git clone https://github.com/simplecontainer/examples.git
smrctl apply examples/dashboard --set user=$USER
smrctl ps
NODE                    RESOURCE                                            IMAGE                                             PORTS                 ENGINE STATE      SMR STATE        
smr-development-node-1  containers/dashboard/dashboard-dashboard-oss-1      quay.io/simplecontainer/dashboard-oss:latest      8080:3000             running (docker)  running (43s)    
smr-development-node-1  containers/dashboard/dashboard-proxy-manager-oss-1  quay.io/simplecontainer/proxy-manager-oss:latest  5443:5443, 5480:5480  running (docker)  running (1m18s)  

To access the dashboard open in the browser http://localhost:8080.

Simplecontainer Containers Simplecontainer GitOps

Deploy First Container

Deploy a basic container definition on Docker using simplecontainer:

smrctl apply https://raw.githubusercontent.com/simplecontainer/examples/refs/heads/main/tests/minimal/definitions/Containers.yaml
smrctl ps

Expected output:

NODE                    RESOURCE                              PORTS  DEPS  ENGINE STATE      SMR STATE     
simplecontainer-node-1  containers/example/example-busybox-1  -      -     running (docker)  running (9s)  

Architecture

Simplecontainer supports three deployment modes:

  1. Single Node: Standalone Docker daemon management
  2. Multiple Isolated Nodes: Independent Simplecontainer instances
  3. Clustered Nodes: Distributed container orchestration

Core Components

  • Control Plane: REST API for container management (port 1443)
  • RAFT Consensus: Distributed state management (port 9212)
  • Embedded etcd: Local key-value store (port 2379, localhost only)
  • Flannel Networking: Overlay network with WireGuard encryption
  • DNS Server: Isolated DNS resolution for containers

Deployment Modes

Single Node Deployment

Localhost Access Only

smrmgr start

External Access

Replace smr.example.com with your domain:

smrmgr start -d smr.example.com
smr agent export --api smr.example.com:1443

From external machines:

smrctl context import PASTE_EXPORTED_CONTEXT_HERE
smrctl ps

Cluster Deployment

Node 1 (Cluster Leader)

smrmgr start -n simplecontainer-1 -d smr-1.example.com
smr agent export --api smr-1.example.com:1443

Node 2+ (Joining Nodes)

smr agent import --node simplecontainer-2 -y PASTE_EXPORTED_OUTPUT
smrmgr start -n simplecontainer-2 -d smr-2.example.com -j -p smr-1.example.com

Container Management

Simplecontainer uses YAML definitions to manage containers and related resources:

Core Objects

  • Containers: Define container specifications
  • Configuration: Application configuration management
  • Secrets: Secure credential storage
  • Resources: Shared resources between containers
  • GitOps: Git-based deployment automation
  • CertKey: TLS certificate management
  • HttpAuth: HTTP authentication configuration

GitOps Workflow

  1. Create GitOps definition:
smrctl apply https://raw.githubusercontent.com/simplecontainer/examples/refs/heads/main/tests/gitops-apps/definitions/gitops-plain.yaml
  1. Check GitOps status:
smrctl ps gitops
  1. Trigger synchronization:
smrctl sync gitops/examples/plain-manual
  1. Verify deployment:
smrctl ps

Direct Application Deployment

For immediate deployment without GitOps:

git clone https://github.com/simplecontainer/examples
smrctl apply examples/tests/dependency-readiness-simple

This example demonstrates:

  • Secret management
  • Configuration handling
  • Resource sharing
  • Container dependencies
  • Readiness checks

Advanced Features

Dependency Management

Containers can depend on other containers being ready:

spec:
  dependencies:
    - mysql.*  # Wait for all mysql containers to be ready

Readiness Probes

Ensure containers are ready before marking them as available:

spec:
  readiness:
    - name: "mysql"
      timeout: "60s"
      command: ["mysqladmin", "ping", "-h", "localhost", "-p(( .password ))"]

Server-Side Rendering

Use secrets and configuration in container definitions:

spec:
  configuration:
      username: "root"
      password: (( lookup "secret/mysql/password:password" | base64decode ))

Network Ports

  • 1443: Control plane API (TCP)
  • 9212: RAFT protocol communication (TCP)
  • 2379: Embedded etcd (localhost only)

Command Reference

Basic Commands

# List all containers
smrctl ps

# List specific resource types
smrctl ps gitops
smrctl ps secrets

# Get detailed information
smrctl get containers/example/busybox-1

# Apply definitions
smrctl apply <file_or_url>

# Sync GitOps resources
smrctl sync gitops/example/app

# Import/export contexts
smrctl context import <context_string>
smrctl context export

Management Commands

# Start node
smrmgr start [options]

# Install tools
smrmgr install

# Export agent context
smr agent export --api <endpoint>

# Import agent context
smr agent import --node <name> -y <context>

Troubleshooting

Common Issues

  1. WireGuard not installed: Install WireGuard package for secure networking
  2. Port conflicts: Ensure ports 1443, 9212, and 2379 are available
  3. Docker socket access: Simplecontainer needs access to /var/run/docker.sock
  4. Firewall: Open required ports for cluster communication

Logs and Debugging

# View container logs
smr node logs OR docker logs <simplecontainer_container_id>

# Verify cluster connectivity
smrctl ps

Resources

Contributing

We welcome contributions! Please see our contributing guidelines and code of conduct.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

About

Simplecontainer manager a.k.a smr. Standalone and cluster mode, GitOps, Secrets, Reconciliation, and YAML definitions for Docker.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages

0