Skip to main content

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

Project description

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

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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

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

Hashes for ocular-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8ff6b6330f5df4f0e52c30d90a815085f7f96468277468af3da8f191210bb626
MD5 e6450f6426e9dc4ac2f2e0ae0d221a98
BLAKE2b-256 7675947e0c1dce363c3df37d4f4c609546a5eff05424b8a4b1309847b30a4282

See more details on using hashes here.

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

Hashes for ocular-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7779c6fb0a46b57eff634361a2052a429910be0e1b7c1c92984217eb8b384a97
MD5 50c74fefd6654c8aec2472cca932c914
BLAKE2b-256 a2dadf069bdcfe6adedf772c424672c1c1d8929e3fb56294456e0f584a82a27a

See more details on using hashes here.

Supported by

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