Requirements
The library requires Python 3.10 or higher.
Installation Methods
1
Install from PyPI (Recommended)
Install the latest stable version from PyPI using your preferred package manager:
uv is a fast Python package installer and is the recommended tool for managing dependencies.
2
Install from Source
For development or to use the latest features, install directly from the source repository:To use the local installation in another project:
3
Verify Installation
Verify the installation by importing the library:
Dependencies
The library automatically installs the following key dependencies:- kubernetes (>=31.0.0) - Official Kubernetes Python client
- timeout-sampler - Utilities for waiting and polling resources
- python-simple-logger - Logging utilities
- deepdiff - Deep comparison of resource states
- jsonschema - Schema validation for resources
- requests - HTTP library for API calls
Authentication Setup
The wrapper supports multiple authentication methods. Configure your cluster access using one of the following:Using kubeconfig (Default)
Using kubeconfig (Default)
The library automatically reads from your kubeconfig file:
Using Bearer Token
Using Bearer Token
Authenticate using an API token:
Using Username and Password
Using Username and Password
Authenticate with basic credentials (uses OAuth flow):
Using Configuration Dictionary
Using Configuration Dictionary
Pass kubeconfig as a dictionary:
Environment Configuration
Logging
Control the logging level for the wrapper:Proxy Configuration
Route traffic through a proxy server:Additional Features
Fake Kubernetes Client
For testing without a real cluster, use the built-in fake client:Command-Line Tools
The library includes command-line utilities:- class-generator - Generate resource classes from OpenShift API schemas
- openshift-mcp-server - MCP server for exposing OpenShift functionality
Next Steps
Quickstart Guide
Get started with basic operations and examples
Core Concepts
Learn about resources, clients, and patterns