lazo
Project description
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
$ 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lazo-1.6.tar.gz
(14.8 kB
view details)
Built Distribution
lazo-1.6-py2.py3-none-any.whl
(17.2 kB
view details)
File details
Details for the file lazo-1.6.tar.gz
.
File metadata
- Download URL: lazo-1.6.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e978774e399cf0d68621c14251a62175d0968247609273e5912326237d40ba9 |
|
MD5 | b2f66006fa5bb510bd99239d3c9f6bc8 |
|
BLAKE2b-256 | 664d0871c94054aade09e7b23079698d9d750b1afd3a0a40c258e8306d8c9ee2 |
Provenance
File details
Details for the file lazo-1.6-py2.py3-none-any.whl
.
File metadata
- Download URL: lazo-1.6-py2.py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 339f817afa7e83ae25f4ebfab3d69e95df0c835fd43bfbfeb49352816a794898 |
|
MD5 | 3a6284b9fc9168d266c3ebaa5a76c0ff |
|
BLAKE2b-256 | e819fa2e6f0d28301a95e76e69279635230a5743dcacd9eeb38515236f465d73 |