## Lazo
[![PyPI version](https://badge.fury.io/py/lazo.svg)](https://badge.fury.io/py/lazo)
Small utility to work with Rancher. It has been developd to be used in CI environments.
Current features:
- get infos on running cluster/project/workload
- get docker image info
- upgrade workload
- execute commands in running containers
### Install
$ pip install lazo
or using [pipx](https://pypi.org/project/pipx/)
$ pipx install lazo
### Help
$ lazo --help
Usage: lazo [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
--env
-v, --verbosity verbosity level
-q, --quit no output
-d, --dry-run dry-run mode
--debug debug mode
-h, --help Show this message and exit.
Commands:
docker
rancher
### Environment varialbles
- RANCHER_BASE_URL as `--base-url`
- RANCHER_KEY as `--key`
- RANCHER_SECRET as `--secret`
- RANCHER_CLUSTER as `--cluster`
- RANCHER_PROJECT as `--project`
- RANCHER_INSECURE as `--inxecure`
- DOCKER_REPOSITORY as `--repository`
You can inspect your default configuration with:
$ lazo --defaults
Env Value Origin
repository https://hub.docker.com/v2
auth
base_url
cluster
insecure False
project
use_names False
or list handler environment variables with:
$ lazo --env
Env Value
DOCKER_REPOSITORY -- not set --
RANCHER_AUTH -- not set --
RANCHER_BASE_URL -- not set --
RANCHER_CLUSTER -- not set --
RANCHER_INSECURE -- not set --
RANCHER_PROJECT -- not set --
RANCHER_USE_NAMES -- not set --
### Examples
#### Rancher
##### get infos on running workload
$ lazo rancher -i -n info -p cluster1:bitcaster -w bitcaster:bitcaster
Workload infos:
Image: bitcaster/bitcaster:0.3.0a15
Command: ['stack']
imagePullPolicy: Always
##### upgrading workload
$ export RANCHER_KEY=key
$ export RANCHER_SECRET=secret
$ lazo upgrade saxix/devpi:latest \
--base-url https://rancher.example.com/v3/
--cluster c-wwk6v
--project p-xd4dg
##### use stdin to read credentials
$ cat .pass.txt | lazo --stdin \
upgrade bitcaster:bitcaster \
bitcaster/bitcaster:0.3.0a10 \
--insecure
##### execute command in running container
$ lazo shell bitcaster:db -- ls -al /var/log
total 432
drwxr-xr-x 1 root root 4096 Jan 1 01:39 .
drwxr-xr-x 1 root root 4096 Dec 26 00:00 ..
drwxr-xr-x 1 root root 4096 Jan 1 01:39 apt
-rw-r--r-- 1 root root 74886 Jan 1 01:39 dpkg.log
-rw-r--r-- 1 root root 32000 Jan 1 01:39 faillog
drwxr-xr-x 2 root root 4096 May 25 2017 sysstat
#### Docker
##### list image available tags
$ lazo docker info saxix/devpi
latest
2.3
2.2
2.1
2.0
1.1
##### get information on image
$ lazo docker info library/python --filter '3\.6.*alpine3.8' --size
3.6-alpine3.8 26.2MiB
3.6.8-alpine3.8 26.2MiB
3.6.7-alpine3.8 26.2MiB
3.6.6-alpine3.8 26.2MiB
Raw data
{
"_id": null,
"home_page": "https://github.com/saxix/lazo",
"name": "lazo",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "docker,rancher",
"author": "sax",
"author_email": "s.apostolico@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/68/1f/6cc061803af231d87eff360173e223df9714efc63086e5cdcad63f82a8d0/lazo-2.0.2.tar.gz",
"platform": null,
"description": "## Lazo\n\n[![PyPI version](https://badge.fury.io/py/lazo.svg)](https://badge.fury.io/py/lazo)\n\nSmall utility to work with Rancher. It has been developd to be used in CI environments.\n\nCurrent features:\n\n - get infos on running cluster/project/workload\n - get docker image info\n - upgrade workload \n - execute commands in running containers\n \n \n### Install\n\n $ pip install lazo\n \nor using [pipx](https://pypi.org/project/pipx/) \n\n $ pipx install lazo\n \n### Help \n \n $ lazo --help\n Usage: lazo [OPTIONS] COMMAND [ARGS]...\n \n Options:\n --version Show the version and exit.\n --env\n -v, --verbosity verbosity level\n -q, --quit no output\n -d, --dry-run dry-run mode\n --debug debug mode\n -h, --help Show this message and exit.\n \n Commands:\n docker\n rancher \n\n\n### Environment varialbles \n\n- RANCHER_BASE_URL as `--base-url`\n- RANCHER_KEY as `--key`\n- RANCHER_SECRET as `--secret`\n- RANCHER_CLUSTER as `--cluster`\n- RANCHER_PROJECT as `--project`\n- RANCHER_INSECURE as `--inxecure`\n- DOCKER_REPOSITORY as `--repository`\n\nYou can inspect your default configuration with:\n\n $ lazo --defaults\n Env Value Origin\n repository https://hub.docker.com/v2\n auth\n base_url\n cluster\n insecure False\n project\n use_names False\n \nor list handler environment variables with:\n\n $ lazo --env\n Env Value\n DOCKER_REPOSITORY -- not set --\n RANCHER_AUTH -- not set --\n RANCHER_BASE_URL -- not set --\n RANCHER_CLUSTER -- not set --\n RANCHER_INSECURE -- not set --\n RANCHER_PROJECT -- not set --\n RANCHER_USE_NAMES -- not set -- \n\n\n### Examples\n\n#### Rancher\n\n##### get infos on running workload\n \n $ lazo rancher -i -n info -p cluster1:bitcaster -w bitcaster:bitcaster\n Workload infos:\n Image: bitcaster/bitcaster:0.3.0a15\n Command: ['stack']\n imagePullPolicy: Always \n\n##### upgrading workload\n\n $ export RANCHER_KEY=key\n $ export RANCHER_SECRET=secret\n $ lazo upgrade saxix/devpi:latest \\\n --base-url https://rancher.example.com/v3/\n --cluster c-wwk6v\n --project p-xd4dg\n \n##### use stdin to read credentials\n\n $ cat .pass.txt | lazo --stdin \\\n upgrade bitcaster:bitcaster \\\n bitcaster/bitcaster:0.3.0a10 \\\n --insecure\n\n##### execute command in running container\n\n $ lazo shell bitcaster:db -- ls -al /var/log\n total 432\n drwxr-xr-x 1 root root 4096 Jan 1 01:39 .\n drwxr-xr-x 1 root root 4096 Dec 26 00:00 ..\n drwxr-xr-x 1 root root 4096 Jan 1 01:39 apt\n -rw-r--r-- 1 root root 74886 Jan 1 01:39 dpkg.log\n -rw-r--r-- 1 root root 32000 Jan 1 01:39 faillog\n drwxr-xr-x 2 root root 4096 May 25 2017 sysstat\n\n\n#### Docker\n\n##### list image available tags\n\n $ lazo docker info saxix/devpi\n latest\n 2.3\n 2.2\n 2.1\n 2.0\n 1.1\n\n##### get information on image\n\n $ lazo docker info library/python --filter '3\\.6.*alpine3.8' --size\n 3.6-alpine3.8 26.2MiB\n 3.6.8-alpine3.8 26.2MiB\n 3.6.7-alpine3.8 26.2MiB\n 3.6.6-alpine3.8 26.2MiB\n",
"bugtrack_url": null,
"license": "",
"summary": "lazo",
"version": "2.0.2",
"split_keywords": [
"docker",
"rancher"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1755eac588b8628c97910a1966caa303498b81218fde0b4afb0c8bf14a48fd8d",
"md5": "8dd031a4aaa2adb6ffcf973bfcfaaaa1",
"sha256": "9e17ee8e6dbd4f65f777c7819b40b051fe20a888225fadd037787fdfe635c1bd"
},
"downloads": -1,
"filename": "lazo-2.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8dd031a4aaa2adb6ffcf973bfcfaaaa1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 14436,
"upload_time": "2023-02-06T17:40:23",
"upload_time_iso_8601": "2023-02-06T17:40:23.612008Z",
"url": "https://files.pythonhosted.org/packages/17/55/eac588b8628c97910a1966caa303498b81218fde0b4afb0c8bf14a48fd8d/lazo-2.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "681f6cc061803af231d87eff360173e223df9714efc63086e5cdcad63f82a8d0",
"md5": "dab2674b5a4dd96e3bdb7b2184eca394",
"sha256": "7f3f115c5aecfa591be5fa0e2186f67cdfba93708a41a9ef93d599428eab77af"
},
"downloads": -1,
"filename": "lazo-2.0.2.tar.gz",
"has_sig": false,
"md5_digest": "dab2674b5a4dd96e3bdb7b2184eca394",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 13451,
"upload_time": "2023-02-06T17:40:25",
"upload_time_iso_8601": "2023-02-06T17:40:25.639777Z",
"url": "https://files.pythonhosted.org/packages/68/1f/6cc061803af231d87eff360173e223df9714efc63086e5cdcad63f82a8d0/lazo-2.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-06 17:40:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "saxix",
"github_project": "lazo",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "lazo"
}