A tool for observing Kubernetes pods' statuses in real time.
Project description
[](LICENSE)
[](https://travis-ci.com/polyaxon/ocular)
[](https://badge.fury.io/py/ocular)
[](https://www.codacy.com/app/polyaxon/ocular?utm_source=github.com&utm_medium=referral&utm_content=polyaxon/ocular&utm_campaign=Badge_Grade)
[](https://join.slack.com/t/polyaxon/shared_invite/enQtMzQ0ODc2MDg1ODc0LWY2ZTdkMTNmZjBlZmRmNjQxYmYwMTBiMDZiMWJhODI2ZTk0MDU4Mjg5YzA5M2NhYzc5ZjhiMjczMDllYmQ2MDg)
# 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
```bash
$ pip install -U ocular
```
## Usage
```python
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
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fpolyaxon%2Focular?ref=badge_large)
[](https://travis-ci.com/polyaxon/ocular)
[](https://badge.fury.io/py/ocular)
[](https://www.codacy.com/app/polyaxon/ocular?utm_source=github.com&utm_medium=referral&utm_content=polyaxon/ocular&utm_campaign=Badge_Grade)
[](https://join.slack.com/t/polyaxon/shared_invite/enQtMzQ0ODc2MDg1ODc0LWY2ZTdkMTNmZjBlZmRmNjQxYmYwMTBiMDZiMWJhODI2ZTk0MDU4Mjg5YzA5M2NhYzc5ZjhiMjczMDllYmQ2MDg)
# 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
```bash
$ pip install -U ocular
```
## Usage
```python
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
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fpolyaxon%2Focular?ref=badge_large)
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
ocular-0.1.0.tar.gz
(7.5 kB
view details)
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.0.tar.gz.
File metadata
- Download URL: ocular-0.1.0.tar.gz
- Upload date:
- Size: 7.5 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 |
2c949734cea9e9db62e2ab568fbf8a846108d708470c34717f666657be876f86
|
|
| MD5 |
cee689fb97727a76b74f9affa3e32c5c
|
|
| BLAKE2b-256 |
533522f2471314504e663bd7349e1f27138bf15d3f91c65de41830dcf4506ca5
|
File details
Details for the file ocular-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: ocular-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.2 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 |
49bb7a8ebfb9080be188178b746565429829291eb029117608e2caf8ff314d35
|
|
| MD5 |
3ef01b2dcf5562568048b9acd6505fa2
|
|
| BLAKE2b-256 |
5761f33cf398fa7fc8418d0f44cd0ce3f509170e8cfe621755a7ef1b5f457a6c
|