Skip to main content

Kubernetes Operations Tools

Project description

k8ops - Kubernetes Operations Tools

Publish Python Package to PyPI

A collection of tools to help with Kubernetes cluster operations and management.

Installation

You can install k8ops using pip:

pip install k8ops

Or using uv:

uv pip install k8ops

Requirements

  • Python 3.7+
  • kubectl configured with access to your Kubernetes cluster

Features

Node Summary

The node summary command provides detailed information about cluster nodes:

k8ops cluster summary [options] [node_names...]

Options

  • --wide: Show wide output with additional columns
  • --pods: Show pods running on each node
  • --images: Show container images on each node
  • --taints: Show node taints
  • --labels: Show node labels
  • --annotations: Show node annotations
  • --capacity: Show node capacity
  • --allocatable: Show node allocatable resources
  • --conditions: Show node conditions
  • --addresses: Show node addresses
  • --metrics: Show node metrics
  • --all: Show all information

Node Drain Analyzer

The node drain analyzer helps assess the impact and risks of draining nodes from your Kubernetes cluster:

k8ops cluster drain [options] <node_names...>

Features

  • Comprehensive drain impact analysis:
    • Resource usage evaluation (CPU, memory, pods)
    • Pod scheduling constraints check
    • Architecture and OS compatibility verification
    • Taint and toleration validation
    • DaemonSet impact assessment
    • Running jobs/cronjobs detection
    • Node selector and affinity rules check
    • Resource availability calculation

Options

All options from the summary command are supported, plus:

  • --factor: The factor for resource calculations when pods have no requests set (default: 1.5)

Analysis Details

The analyzer checks for various potential issues:

  1. Resource Constraints

    • CPU and memory availability on remaining nodes
    • Pod capacity limits
    • Resource distribution impact
  2. Scheduling Constraints

    • Node selectors compatibility
    • Affinity/anti-affinity rules
    • Taints and tolerations
    • Architecture/OS compatibility
  3. Workload Impact

    • DaemonSet pods
    • Running jobs/cronjobs
    • Pods with no controllers
    • Pod density changes

Severity Levels

  • High: Critical issues that will likely prevent successful node draining
  • Medium: Significant issues that may cause problems
  • Low: Minor issues that should be reviewed
  • None: No issues detected

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

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

k8ops-0.0.2.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

k8ops-0.0.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file k8ops-0.0.2.tar.gz.

File metadata

  • Download URL: k8ops-0.0.2.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for k8ops-0.0.2.tar.gz
Algorithm Hash digest
SHA256 60ccb97e35b6fe3ed2a4072549a7feb1fe6314a95566b67945f81ce722b48351
MD5 553904f2c170fdfdb99013ac6fefddd2
BLAKE2b-256 d418af71f0f08c4ec0f68f07e1fcac8f37373968a951d34a896e6a75cab2aa4a

See more details on using hashes here.

File details

Details for the file k8ops-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: k8ops-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for k8ops-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3fd799dea839d21b79bbdbcaf77afb44145baac82d275fecbaa710cf421ded56
MD5 badf1a8ff942bfb4bc356a861b6ef134
BLAKE2b-256 ea7a7437ded067142852ca4eaec6296e20f57324c5d883a94748125aa67cc19d

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