Skip to main content

License: MIT Build Status PyPI version Codacy Badge Slack

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

FOSSA Status

Metadata

Release files for ocular 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocular 0.1.7
File Size Uploaded
ocular-0.1.7.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocular 0.1.7
File Interpreter ABI Platform
ocular-0.1.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 14.8 kB

Release files / ocular-0.1.7.tar.gz

Download URL ocular-0.1.7.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8ff6b6330f5df4f0e52c30d90a815085f7f96468277468af3da8f191210bb626
BLAKE2b-256 checksum
How to use checksums
7675947e0c1dce363c3df37d4f4c609546a5eff05424b8a4b1309847b30a4282
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ocular-0.1.7-py2.py3-none-any.whl

Download URL ocular-0.1.7-py2.py3-none-any.whl
Size 7.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7779c6fb0a46b57eff634361a2052a429910be0e1b7c1c92984217eb8b384a97
BLAKE2b-256 checksum
How to use checksums
a2dadf069bdcfe6adedf772c424672c1c1d8929e3fb56294456e0f584a82a27a
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page