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

Alternatively, you can download and use the standalone scripts directly from the repository.

Node Drain Analyzer

The Node Drain Analyzer is a tool that helps you assess the impact and risk of draining nodes in your Kubernetes cluster. It analyzes various factors such as resource usage, pod placement constraints, and node characteristics to provide insights into potential issues that might arise when draining specific nodes.

Features

  • Comprehensive analysis of node drain impact
  • Resource usage evaluation (CPU, memory, pods)
  • Detection of scheduling constraints (taints, tolerations, node selectors)
  • Architecture and operating system compatibility checks
  • Detailed reporting with severity levels
  • Multiple output formats (table, JSON, CSV)

Requirements

  • Python 3.6+
  • kubectl configured with access to your Kubernetes cluster
  • Required Python packages (standard library)

Usage

If installed via pip:

node-drain-analyzer [options] [node_names...]

If using the standalone script:

python node-drain-analyzer [options] [node_names...]

Options

  • --wide: Show wide output with additional columns
  • --output, -o: Output destination (default: stdout)
  • --verbose, -v: Enable verbose output
  • --images: Show images information
  • --pods: Show pods information
  • --taints: Show taints information
  • --metrics: Show metrics information
  • --factor: The factor for resource calculations (default: 1.5)

Examples

Analyze the impact of draining a single node:

node-drain-analyzer node-1

Analyze multiple nodes with verbose output:

node-drain-analyzer -v node-1 node-2

Show detailed information including pods and taints:

node-drain-analyzer --pods --taints node-1

Save analysis to a file:

node-drain-analyzer -o analysis.txt node-1

How It Works

  1. Collects information about all nodes and pods in the cluster
  2. Simulates removing the specified nodes
  3. Analyzes the impact on the remaining nodes
  4. Checks for potential issues like:
    • Resource constraints
    • Pod scheduling constraints
    • Architecture/OS compatibility
    • Taints and tolerations
  5. Generates a report with severity levels for identified issues

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.1.tar.gz (13.8 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.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: k8ops-0.0.1.tar.gz
  • Upload date:
  • Size: 13.8 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.1.tar.gz
Algorithm Hash digest
SHA256 0b7c311142cf77d8245fed441710ef91794cf44b6f6382e73214ad877cdcf770
MD5 418eb09209f21bdcdb0b2958b2cae270
BLAKE2b-256 ff853b0c44755e7eda624572fd7714b995fb389d70df9b5e3d62eb4fe785bfae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: k8ops-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 763b6d1259d5c651b249b1373fb83468bc35853a9c1915c24bcb22bc38dd1e79
MD5 4dfcd3c7c5116ff986f31cdfd92c63df
BLAKE2b-256 20223a444ac4c8cccb773280e2eb01476c9d91a53bc1092cf4b839a5ac41c2f0

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