Simplified Container System
Switch branches/tags
Nothing to show
Clone or download
ehazlett update release target
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Latest commit 5afb0e1 Nov 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api event service: add cluster wide event system Oct 27, 2018
client event service: add cluster wide event system Oct 27, 2018
cmd event service: add cluster wide event system Oct 27, 2018
contrib add default stellar conf for package Sep 20, 2018
docs update docs; fix cni bug with delete Aug 17, 2018
events event service: add cluster wide event system Oct 27, 2018
hack update hack script Jun 29, 2018
server event service: add cluster wide event system Oct 27, 2018
services blackbird -> stellarproject/radiant Nov 6, 2018
vendor Config Simplification and Element Upgrade (#12) Oct 26, 2018
version increase replication interval Jul 10, 2018
.gitignore add test output to gitignore Sep 19, 2018
Dockerfile update golint import path Oct 25, 2018
Dockerfile.build update readme Nov 6, 2018
Dockerfile.dev update golint import path Oct 25, 2018
Dockerfile.docs start on docs Jun 22, 2018
Dockerfile.package update golint import path Oct 25, 2018
Dockerfile.test update golint import path Oct 25, 2018
LICENSE add license Sep 14, 2018
Makefile update release target Nov 7, 2018
Protobuild.grpc-gateway.toml [RFC] Expose gRPC services as http json API for web clients (#8) Oct 3, 2018
Protobuild.toml [RFC] Expose gRPC services as http json API for web clients (#8) Oct 3, 2018
README.md update readme Nov 7, 2018
app.conf.example apps: list command; release container ip Aug 5, 2018
config.go event service: add cluster wide event system Oct 27, 2018
containerd.go enable running applications Aug 5, 2018
go.mod blackbird -> stellarproject/radiant Nov 6, 2018
go.sum blackbird -> stellarproject/radiant Nov 6, 2018
mkdocs.yml start on docs Jun 22, 2018
proto.go [RFC] Expose gRPC services as http json API for web clients (#8) Oct 3, 2018
stellar.go wip Sep 7, 2018

README.md

   _____ __       ____
  / ___// /____  / / /___ ______
  \__ \/ __/ _ \/ / / __ `/ ___/
 ___/ / /_/  __/ / / /_/ / /
/____/\__/\___/_/_/\__,_/_/

Simplified Container Runtime Cluster

Stellar is designed to provide simple container runtime clustering. One or more nodes are joined together to create a cluster. The cluster is eventually consistent making it ideal for transient workloads or edge computing where nodes are not always guaranteed to have high bandwidth, low latency connectivity.

Why

There are several container platforms and container orchestrators out there. However, they are too complex for my use. I like simple infrastructure that is easy to deploy and manage, tolerates failure cases and is easy to debug when needed. With the increased tolerance in failure modes, this comes at a consistency cost. It may not be for you. Use the best tool for your use case. Enjoy :)

Features

  • Container execution via containerd
  • Multihost Networking via CNI
  • Service Discovery via DNS
  • Cluster event system via NATS
  • Builtin Proxy using Radiant (zero downtime reloads, canary deploys, health checks, automatic HTTPS)
  • Masterless design
  • Efficient use of system resources
  • Simple daemon deployment

Downloads

For official releases, see the Releases

You can also grab the latest Master Build

Building

In order to build Stellar you will need the following:

Once you have the requirements you can build.

If you change / update the protobuf definitions you will need to generate:

make generate

To build the binaries (client and server) run:

make

Docker

Alternatively you can use Docker to build:

To generate protobuf:

make docker-generate

To build binaries:

make docker-build

Running

To run Stellar, once you have a working containerd installation follow these steps:

  • Install Containerd
  • Build binaries or get a release
  • Copy /bin/sctl to /usr/local/bin/
  • Copy /bin/stellar to /usr/local/bin/
  • Copy /bin/stellar-cni-ipam to /opt/containerd/bin/ or /opt/cni/bin

First, we will generate a config:

$> stellar config > stellar.conf

This will produce a default configuration. Edit the addresses to match your environment. For this example we will use the IP 10.0.1.70.

{
    "ConnectionType": "local",
    "ClusterAddress": "10.0.1.70:7946",
    "AdvertiseAddress": "10.0.1.70:7946",
    "Debug": false,
    "NodeID": "dev",
    "GRPCAddress": "10.0.1.70:9000",
    "TLSServerCertificate": "",
    "TLSServerKey": "",
    "TLSClientCertificate": "",
    "TLSClientKey": "",
    "TLSInsecureSkipVerify": false,
    "ContainerdAddr": "/run/containerd/containerd.sock",
    "Namespace": "default",
    "DataDir": "/var/lib/stellar",
    "StateDir": "/run/stellar",
    "Bridge": "stellar0",
    "UpstreamDNSAddr": "8.8.8.8:53",
    "ProxyHTTPPort": 80,
    "ProxyHTTPSPort": 443,
    "ProxyTLSEmail": "",
    "GatewayAddress": "127.0.0.1:9001",
    "EventsAddress": "10.0.1.70:4222",
    "EventsClusterAddress": "10.0.1.70:5222",
    "EventsHTTPAddress": "10.0.1.70:4322",
    "CNIBinPaths": [
        "/opt/containerd/bin",
        "/opt/cni/bin"
    ],
    "Peers": [],
    "Subnet": "172.16.0.0/12"
}

To start the initial node run:

$> stellar -D server --config stellar.conf

To join additional nodes simply add the AdvertiseAddress of the first node to the Peers config option of the second node:

For example:

{
    "ConnectionType": "local",
    "ClusterAddress": "10.0.1.71:7946",
    "AdvertiseAddress": "10.0.1.71:7946",
    "Debug": false,
    "NodeID": "dev",
    "GRPCAddress": "10.0.1.71:9000",
    "TLSServerCertificate": "",
    "TLSServerKey": "",
    "TLSClientCertificate": "",
    "TLSClientKey": "",
    "TLSInsecureSkipVerify": false,
    "ContainerdAddr": "/run/containerd/containerd.sock",
    "Namespace": "default",
    "DataDir": "/var/lib/stellar",
    "StateDir": "/run/stellar",
    "Bridge": "stellar0",
    "UpstreamDNSAddr": "8.8.8.8:53",
    "ProxyHTTPPort": 80,
    "ProxyHTTPSPort": 443,
    "ProxyTLSEmail": "",
    "GatewayAddress": "127.0.0.1:9001",
    "EventsAddress": "10.0.1.71:4222",
    "EventsClusterAddress": "10.0.1.71:5222",
    "EventsHTTPAddress": "10.0.1.71:4322",
    "CNIBinPaths": [
        "/opt/containerd/bin",
        "/opt/cni/bin"
    ],
    "Peers": ["10.0.1.70:7946"],
    "Subnet": "172.16.0.0/12"
}

You will now have a two node cluster. To see node information, use sctl.

$> sctl --addr 10.0.1.70:9000 cluster nodes
NAME                ADDR                OS                       UPTIME              CPUS                MEMORY (USED)
stellar-00          10.0.1.70:9000      Linux (4.17.0-3-amd64)   7 seconds           2                   242 MB / 2.1 GB
stellar-01          10.0.1.71:9000      Linux (4.17.0-3-amd64)   6 seconds           2                   246 MB / 2.1 GB

Deploying an Application

To deploy an application, create an application config. For example, create the following as example.conf:

{
    "name": "example",
    "labels": [
        "env=prod",
        "region=us-east"
    ],
    "services": [
        {
            "name": "redis",
            "image": "docker.io/library/redis:alpine",
            "runtime": "io.containerd.runtime.v1.linux",
            "process": {
                "uid": 0,
                "gid": 0,
                "args": ["redis-server"]
            },
            "labels": [
                "env=prod"
            ],
            "network": true
        }
    ]
}

Then run the following to deploy:

$> sctl --addr 10.0.1.70:9000 apps create -f ./example.conf

You should now see the application deployed:

$> sctl --addr 10.0.1.70:9000 apps list
NAME                SERVICES
example             1

$> sctl --addr 10.0.1.70:9000 apps inspect example
Name: example
Services:
  - Name: example.redis
    Image: docker.io/library/redis:alpine
    Runtime: io.containerd.runtime.v1.linux
    Snapshotter: overlayfs
    Labels:
      containerd.io/restart.status=running
      stellar.io/application=example
      stellar.io/network=true

By default all applications that have networking enabled will have a corresponding nameserver record created. To view the records use the following:

$> sctl --addr 10.0.1.70:9000 nameserver list
NAME                    TYPE                VALUE                                            OPTIONS
example.redis.stellar   A                   172.16.0.4
example.redis.stellar   TXT                 node=stellar-00; updated=2018-09-08T10:71:02-04:00