Skip to main content

Command line tool to explore the Kubernetes API using Python expressions

Project description

Kubernetes Python Exploration Tool

Command line tool to explore the Kubernetes API using Python expressions

PyPi Code style: black

Motivation

Explore the Kubernetes API by using «k8s tailored» REST client while supporting Python expressions for formatting and filterting data.

Install

pip install kpet

Usage examples

Show the current kubernetes context configuration (detected from your KUBECONFIG file)

kpet show

List all the API endpoints

kpet get

Get the kubernetes API server version

kpet get version

Get the list of nodes

kpet get api/v1/nodes

Get the PodIP for all pods, check the special symbols for other symbols.

kpet get api/v1/pods -f "{name} is using IP {_s.podIP}"

Print the name for all running pods

kpet get api/v1/pods -f"{name}" -s "_s.phase=='Running'"

Print the name for all nodes which are Ready

kpet get api/v1/nodes -f"{name}" -s "[c for c in _s['conditions'] if c.type=='Ready' and c.status=='True']"

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

kpet-0.0.2.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

kpet-0.0.2-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

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