A tool for observing Kubernetes pods' statuses in real time.
Project description
ocular
A tool for observing Kubernetes pods' statuses in real time.
Description
Often times it's very hard to translate a Kubernetes event to a concrete state, and that's the gap that ocular tries fill, i.e. return one of the following statuses:
created
building
unschedulable
scheduled
running
succeeded
failed
stopped
unknown
ocular returns as well a condensed information about the reason of that status.
Install
$ pip install -U ocular
Usage
import ocular
from kubernetes import client
api_client = client.api_client.ApiClient(configuration=...)
for pod_state in ocular.monitor(api_client,
namespace='polyaxon',
container_names=('polyaxon-experiment-job',),
label_selector='app in (workers,dashboard),type=runner'):
print(pod_state)
Results
...
>> {'status': 'unknown', 'message': 'Unknown pod conditions', 'details': {'event_type': 'ADDED', 'labels': ...
>> {'status': 'building', 'message': None, 'details': {'event_type': 'MODIFIED', 'labels': ...
>> {'status': 'building', 'message': 'PodInitializing', 'details': {'event_type': 'MODIFIED', 'labels': ...
>> {'status': 'building', 'message': 'PodInitializing', 'details': {'event_type': 'MODIFIED', 'labels': ...
>> {'status': 'running', 'message': None, 'details': {'event_type': 'MODIFIED', 'labels': ...
>> {'status': 'running', 'message': None, 'details': {'event_type': 'MODIFIED', 'labels': ...
>> {'status': 'succeeded', 'message': None, 'details': {'event_type': 'MODIFIED', 'labels': ...
...
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ocular-0.1.7.tar.gz.
File metadata
- Download URL: ocular-0.1.7.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff6b6330f5df4f0e52c30d90a815085f7f96468277468af3da8f191210bb626
|
|
| MD5 |
e6450f6426e9dc4ac2f2e0ae0d221a98
|
|
| BLAKE2b-256 |
7675947e0c1dce363c3df37d4f4c609546a5eff05424b8a4b1309847b30a4282
|
File details
Details for the file ocular-0.1.7-py2.py3-none-any.whl.
File metadata
- Download URL: ocular-0.1.7-py2.py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7779c6fb0a46b57eff634361a2052a429910be0e1b7c1c92984217eb8b384a97
|
|
| MD5 |
50c74fefd6654c8aec2472cca932c914
|
|
| BLAKE2b-256 |
a2dadf069bdcfe6adedf772c424672c1c1d8929e3fb56294456e0f584a82a27a
|