Skip to main content

A tool for observing Kubernetes pods' statuses in real time.

Project description

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Build Status](https://travis-ci.com/polyaxon/ocular.svg?branch=master)](https://travis-ci.com/polyaxon/ocular)
[![PyPI version](https://badge.fury.io/py/ocular.svg)](https://badge.fury.io/py/ocular)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a33947d729f94f5da7f7390dfeef7f94)](https://www.codacy.com/app/polyaxon/ocular?utm_source=github.com&utm_medium=referral&utm_content=polyaxon/ocular&utm_campaign=Badge_Grade)
[![Slack](https://img.shields.io/badge/chat-on%20slack-aadada.svg?logo=slack&longCache=true)](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

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fpolyaxon%2Focular.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fpolyaxon%2Focular?ref=badge_large)


Project details


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.6.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocular-0.1.6-py2.py3-none-any.whl (7.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ocular-0.1.6.tar.gz.

File metadata

  • Download URL: ocular-0.1.6.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

Hashes for ocular-0.1.6.tar.gz
Algorithm Hash digest
SHA256 2700cf13a4102c3aa97deb632ea6193c10b8ff488463f4aa14aa0c1b44c430d8
MD5 aec296f96c1f0cdf3df1e16027c06b43
BLAKE2b-256 b256c0b0e325ca05d46bc88847b4072aab586bac37f48e577f6457cebf7d979a

See more details on using hashes here.

File details

Details for the file ocular-0.1.6-py2.py3-none-any.whl.

File metadata

  • Download URL: ocular-0.1.6-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

Hashes for ocular-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f52f421138ad1e85548b974c13d7fc6249b4e8b53060132884aecd9b2b5a7902
MD5 eb1caeb3a752a33f0beff018c2ebb89f
BLAKE2b-256 49e3698ea435f40f256589e4ce9c82502ca5f91adabecf51bcc9dc545174557d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page