Skip to content

offscale/offregister

offregister

No Maintenance Intended Python version range License black Imports: isort

Tool that uses JSON input to register node(s) to cluster(s). Nodes can be specified directly, or taken from etcd.

New since July 2022: now uses offconf to support ${env.bar}, function calls, and arrow functions within JSON strings. This opens up security risks, as the environment is exposed, disable by setting NO_OFFCONF env var.

Install dependencies

pip install -r requirements.txt

Install package

pip install .

Approach

New entry in register.sample.json:

{
    "register": {
        "/unclustered/*": [
            "coreos",
            "deis"
        ]
    },
    "purpose": [
        "any-cluster"
    ]
}

Usage

usage: __main__.py [-h] [-d DNS] [-i IP] [-q QUEUE] [-l QUEUE_LOCATION]
                   [-r REGISTER [REGISTER ...]] [-c CONFIG] [-w WITHIN]
                   [-m METHOD] [-a METHOD_ARGS]

Register node to cluster(s). Node is found by manual specification, or popped
from a queue.

optional arguments:
  -h, --help            show this help message and exit
  -d DNS, --dns DNS     DNS for node (if no queue)
  -i IP, --ip IP        Public IP for node (if no queue)
  -q QUEUE, --queue QUEUE
                        Type of queue. Default: "etcd"
  -l QUEUE_LOCATION, --queue-location QUEUE_LOCATION
                        Location of queue. Default: "http://localhost:2379"
  -r REGISTER [REGISTER ...], --register REGISTER [REGISTER ...]
                        Join node to which cluster(s). Example:
                        mesos:location, etcd:location
  -c CONFIG, --config CONFIG
                        Schema file. Can use the same one across all off-
                        CLIs.
  -w WITHIN, --within WITHIN
                        Clusters to set nodes within [/unclustered/* (from
                        .json conf)]
  -m METHOD, --method METHOD
                        Method to run. E.g.: `tail` or `set_clusters`.
                        [set_clusters]
  -a METHOD_ARGS, --method-args METHOD_ARGS
                        Method args. Use with --method. Example: "-f -n 20"

Example usage: /usr/local/lib/python2.7/dist-packages/offregister/__main__.py
-q etcd -r mesos:location, etcd:location, consul:location

External recipes

Install external recipes and they'll be imported automatically. If you want them to be installed automatically:

  • set PKG_DIR environment variable to one level above your project, or
  • put your project one dir above offregister's

License

Licensed under any of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

About

Register node(s) to cluster(s). Nodes can be specified directly, or taken from `etcd`

Resources

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
CC0-1.0
LICENSE-CC0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages